summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/class_linker_test.cc4
-rw-r--r--runtime/native_stack_dump.cc2
-rw-r--r--runtime/oat/elf_file.cc5
-rw-r--r--runtime/oat/oat_file_assistant.cc2
-rw-r--r--runtime/oat/oat_file_manager.cc2
-rw-r--r--runtime/verifier/method_verifier_test.cc2
6 files changed, 8 insertions, 9 deletions
diff --git a/runtime/class_linker_test.cc b/runtime/class_linker_test.cc
index df669169e0..932341d895 100644
--- a/runtime/class_linker_test.cc
+++ b/runtime/class_linker_test.cc
@@ -896,12 +896,12 @@ TEST_F(ClassLinkerTest, GetDexFiles) {
jobject jclass_loader = LoadDex("Nested");
std::vector<const DexFile*> dex_files(GetDexFiles(jclass_loader));
ASSERT_EQ(dex_files.size(), 1U);
- EXPECT_TRUE(android::base::EndsWith(dex_files[0]->GetLocation(), "Nested.jar"));
+ EXPECT_TRUE(dex_files[0]->GetLocation().ends_with("Nested.jar"));
jobject jclass_loader2 = LoadDex("MultiDex");
std::vector<const DexFile*> dex_files2(GetDexFiles(jclass_loader2));
ASSERT_EQ(dex_files2.size(), 2U);
- EXPECT_TRUE(android::base::EndsWith(dex_files2[0]->GetLocation(), "MultiDex.jar"));
+ EXPECT_TRUE(dex_files2[0]->GetLocation().ends_with("MultiDex.jar"));
}
TEST_F(ClassLinkerTest, FindClassNested) {
diff --git a/runtime/native_stack_dump.cc b/runtime/native_stack_dump.cc
index ad09762972..5a6cee0630 100644
--- a/runtime/native_stack_dump.cc
+++ b/runtime/native_stack_dump.cc
@@ -236,7 +236,7 @@ static void Addr2line(const std::string& map_src,
std::unique_ptr<Addr2linePipe>* pipe /* inout */) {
std::array<const char*, 3> kIgnoreSuffixes{ ".dex", ".jar", ".vdex" };
for (const char* ignore_suffix : kIgnoreSuffixes) {
- if (android::base::EndsWith(map_src, ignore_suffix)) {
+ if (map_src.ends_with(ignore_suffix)) {
// Ignore file names that do not have map information addr2line can consume. e.g. vdex
// files are special frames injected for the interpreter so they don't have any line
// number information available.
diff --git a/runtime/oat/elf_file.cc b/runtime/oat/elf_file.cc
index 91af410471..c66cba1dd0 100644
--- a/runtime/oat/elf_file.cc
+++ b/runtime/oat/elf_file.cc
@@ -1434,9 +1434,8 @@ bool ElfFileImpl<ElfTypes>::Strip(File* file, std::string* error_msg) {
section_headers_original_indexes.push_back(0);
continue;
}
- if (android::base::StartsWith(name, ".debug")
- || (strcmp(name, ".strtab") == 0)
- || (strcmp(name, ".symtab") == 0)) {
+ std::string_view name_sv(name);
+ if (name_sv.starts_with(".debug") || (name_sv == ".strtab") || (name_sv == ".symtab")) {
continue;
}
section_headers.push_back(*sh);
diff --git a/runtime/oat/oat_file_assistant.cc b/runtime/oat/oat_file_assistant.cc
index 8fcf1c8f57..782b7b3316 100644
--- a/runtime/oat/oat_file_assistant.cc
+++ b/runtime/oat/oat_file_assistant.cc
@@ -701,7 +701,7 @@ bool OatFileAssistant::DexLocationToOatFilename(const std::string& location,
// TODO: The oat file assistant should be the definitive place for
// determining the oat file name from the dex location, not
// GetDalvikCacheFilename.
- return GetDalvikCacheFilename(location.c_str(), dalvik_cache.c_str(), oat_filename, error_msg);
+ return GetDalvikCacheFilename(location, dalvik_cache, oat_filename, error_msg);
}
bool OatFileAssistant::GetRequiredDexChecksum(std::optional<uint32_t>* checksum,
diff --git a/runtime/oat/oat_file_manager.cc b/runtime/oat/oat_file_manager.cc
index fea361b8ee..c32125cf75 100644
--- a/runtime/oat/oat_file_manager.cc
+++ b/runtime/oat/oat_file_manager.cc
@@ -829,7 +829,7 @@ void OatFileManager::RunBackgroundVerification(const std::vector<const DexFile*>
std::string dex_location = dex_files[0]->GetLocation();
const std::string& data_dir = Runtime::Current()->GetProcessDataDirectory();
- if (!android::base::StartsWith(dex_location, data_dir)) {
+ if (!dex_location.starts_with(data_dir)) {
// For now, we only run background verification for secondary dex files.
// Running it for primary or split APKs could have some undesirable
// side-effects, like overloading the device on app startup.
diff --git a/runtime/verifier/method_verifier_test.cc b/runtime/verifier/method_verifier_test.cc
index 1c6ed7c9b0..acfc7b2b19 100644
--- a/runtime/verifier/method_verifier_test.cc
+++ b/runtime/verifier/method_verifier_test.cc
@@ -65,7 +65,7 @@ class MethodVerifierTest : public CommonRuntimeTest {
/* api_level= */ 0u,
&error_msg);
- if (android::base::StartsWith(descriptor, "Ljava/lang/invoke")) {
+ if (descriptor.starts_with("Ljava/lang/invoke")) {
ASSERT_TRUE(failure == FailureKind::kSoftFailure ||
failure == FailureKind::kNoFailure) << error_msg;