[llvm-ar] Simplify the code.
[oota-llvm.git] / tools / llvm-ar / llvm-ar.cpp
index 093f7f9e35dad72a84260ad063bc1e4d3643e90f..cac46d2e50b91727ec70860febbf5a443ef44a89 100644 (file)
@@ -312,18 +312,9 @@ static void doPrint(StringRef Name, const object::Archive::Child &C) {
 // Utility function for printing out the file mode when the 't' operation is in
 // verbose mode.
 static void printMode(unsigned mode) {
-  if (mode & 004)
-    outs() << "r";
-  else
-    outs() << "-";
-  if (mode & 002)
-    outs() << "w";
-  else
-    outs() << "-";
-  if (mode & 001)
-    outs() << "x";
-  else
-    outs() << "-";
+  outs() << ((mode & 004) ? "r" : "-");
+  outs() << ((mode & 002) ? "w" : "-");
+  outs() << ((mode & 001) ? "x" : "-");
 }
 
 // Implement the 't' operation. This function prints out just