diff options
| author | 2024-06-12 09:30:37 +0000 | |
|---|---|---|
| committer | 2024-06-14 10:14:50 +0000 | |
| commit | 2b4eb676348f122ab0a21e19d7a3c57bd9898c6c (patch) | |
| tree | 281ceaa54365c8c38ca94ea484c831aeb1951bf8 /libnativeloader | |
| parent | 9132d9056cc1d4eb342d1a2b0315fc1f054ca2f8 (diff) | |
Use C++20 `string{,_view}::{starts,ends}_with()`, part 2.
Replace uses of `android::base::{Starts,Ends}With()`.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Change-Id: I80a0ca93f433464270989d248dd999e9366a1c17
Diffstat (limited to 'libnativeloader')
| -rw-r--r-- | libnativeloader/library_namespaces.cpp | 2 | ||||
| -rw-r--r-- | libnativeloader/public_libraries.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/libnativeloader/library_namespaces.cpp b/libnativeloader/library_namespaces.cpp index 7b18b15dd0..e0f3d6af8c 100644 --- a/libnativeloader/library_namespaces.cpp +++ b/libnativeloader/library_namespaces.cpp @@ -483,7 +483,7 @@ std::optional<std::string> FindApexNamespaceName(const std::string& location) { // /apex/modulename/... // // And we extract from it 'modulename', and then apply mangling rule to get namespace name for it. - if (android::base::StartsWith(location, kApexPath)) { + if (location.starts_with(kApexPath)) { size_t start_index = strlen(kApexPath); size_t slash_index = location.find_first_of('/', start_index); LOG_ALWAYS_FATAL_IF((slash_index == std::string::npos), diff --git a/libnativeloader/public_libraries.cpp b/libnativeloader/public_libraries.cpp index 53fcd2f35b..3fecd59cf7 100644 --- a/libnativeloader/public_libraries.cpp +++ b/libnativeloader/public_libraries.cpp @@ -126,8 +126,8 @@ void ReadExtensionLibraries(const char* dirname, std::vector<std::string>* sonam Result<std::vector<std::string>> ret = ReadConfig( config_file_path, [&company_name](const struct ConfigEntry& entry) -> Result<bool> { - if (android::base::StartsWith(entry.soname, "lib") && - android::base::EndsWith(entry.soname, "." + company_name + ".so")) { + if (entry.soname.starts_with("lib") && + entry.soname.ends_with("." + company_name + ".so")) { return true; } else { return Errorf( |