odrefresh: Avoid a couple string copies
With the new utility versions of these functions changing their
arguments from "const char *" to "const std::string&", we want
to avoid using c_str(), so we don't end up making an extra
copy of the string.
Bug: 160683548
Test: TreeHugger
(cherry picked from commit 648fefa36c37ec40060b975b893ccc57b7f6ef89)
Merged-In: If547052e8292bb4d9b26ceaa27b4e5e5ca627ea3
Change-Id: Id38387b40b0f7a4f29402fc05e5affab835c7d69
diff --git a/odrefresh/odrefresh.cc b/odrefresh/odrefresh.cc
index 5f8b072..c9c870e 100644
--- a/odrefresh/odrefresh.cc
+++ b/odrefresh/odrefresh.cc
@@ -923,10 +923,10 @@
static void ReportSpace() {
uint64_t bytes;
std::string data_dir = GetArtApexData();
- if (GetUsedSpace(data_dir.c_str(), &bytes)) {
+ if (GetUsedSpace(data_dir, &bytes)) {
LOG(INFO) << "Used space " << bytes << " bytes.";
}
- if (GetFreeSpace(data_dir.c_str(), &bytes)) {
+ if (GetFreeSpace(data_dir, &bytes)) {
LOG(INFO) << "Available space " << bytes << " bytes.";
}
}