idmap2 code cleanup
- proper use of random number generators in FileUtils
- get rid of <iostream> include where possible
- replace std::endl with '\n' as we don't really need stream
flushes
- added a few missed moves
Bug: 282215580
Test: build, UTs and boot
Change-Id: I2dbe5e7c240acd0f344158ae6d9f2ee2b9c2c6ab
diff --git a/cmds/idmap2/libidmap2/CommandLineOptions.cpp b/cmds/idmap2/libidmap2/CommandLineOptions.cpp
index 8129d99..888b3a5 100644
--- a/cmds/idmap2/libidmap2/CommandLineOptions.cpp
+++ b/cmds/idmap2/libidmap2/CommandLineOptions.cpp
@@ -19,8 +19,8 @@
#include <algorithm>
#include <cassert>
#include <iomanip>
-#include <iostream>
#include <memory>
+#include <ostream>
#include <set>
#include <sstream>
#include <string>
@@ -131,7 +131,7 @@
separator = true;
stream << opt << ": missing mandatory option";
}
- stream << std::endl;
+ stream << '\n';
Usage(stream);
return Error("%s", stream.str().c_str());
}
@@ -168,7 +168,7 @@
out << " [" << opt.name << " arg [..]]";
}
}
- out << std::endl << std::endl;
+ out << "\n\n";
for (const Option& opt : options_) {
out << std::left << std::setw(maxLength);
if (opt.argument) {
@@ -181,7 +181,7 @@
opt.count == Option::COUNT_OPTIONAL_ONCE_OR_MORE) {
out << " (can be provided multiple times)";
}
- out << std::endl;
+ out << '\n';
}
}