summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Elliott Hughes <enh@google.com> 2017-12-20 12:34:09 -0800
committer Elliott Hughes <enh@google.com> 2017-12-20 12:34:09 -0800
commit969e4f8b21148db61413abaea788d67f126cde58 (patch)
tree80ed2e2dc2b76ec340f7d546a4541d9cfa617f9f
parenta9c7e6d15201dbb701dc1f535689910a581912b0 (diff)
StartsWith/EndsWith allow std::string prefixes/suffixes now.
Bug: N/A Test: builds Change-Id: I502f7ff687ac164ae9c2c639b4c8eab13291ea62
-rw-r--r--cmds/installd/dexopt.cpp2
-rw-r--r--cmds/installd/otapreopt.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/cmds/installd/dexopt.cpp b/cmds/installd/dexopt.cpp
index 88edd0a55d..29d5c32f16 100644
--- a/cmds/installd/dexopt.cpp
+++ b/cmds/installd/dexopt.cpp
@@ -958,7 +958,7 @@ static std::string replace_file_extension(const std::string& oat_path, const std
if (EndsWith(oat_path, ".dex")) {
std::string new_path = oat_path;
new_path.replace(new_path.length() - strlen(".dex"), strlen(".dex"), new_ext);
- CHECK(EndsWith(new_path, new_ext.c_str()));
+ CHECK(EndsWith(new_path, new_ext));
return new_path;
}
diff --git a/cmds/installd/otapreopt.cpp b/cmds/installd/otapreopt.cpp
index e0d23da34c..8a56894423 100644
--- a/cmds/installd/otapreopt.cpp
+++ b/cmds/installd/otapreopt.cpp
@@ -882,7 +882,7 @@ private:
// backs to do weird things.)
const char* apk_path = package_parameters_.apk_path;
CHECK(apk_path != nullptr);
- if (StartsWith(apk_path, android_root_.c_str())) {
+ if (StartsWith(apk_path, android_root_)) {
const char* last_slash = strrchr(apk_path, '/');
if (last_slash != nullptr) {
std::string path(apk_path, last_slash - apk_path + 1);