| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 4bb00d7 commit 2a54209
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -169,7 +169,7 @@ BuiltinLoader::BuiltinCategories BuiltinLoader::GetBuiltinCategories() const { | |||
| 169 | 169 | if (prefix.length() > id.length()) { | |
| 170 | 170 | continue; | |
| 171 | 171 | } | |
| 172 | - if (id.find(prefix) == 0 && | ||
| 172 | + if (id.starts_with(prefix) && | ||
| 173 | 173 | builtin_categories.can_be_required.count(id) == 0) { | |
| 174 | 174 | builtin_categories.cannot_be_required.emplace(id); | |
| 175 | 175 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -341,7 +341,7 @@ void FromNamespacedPath(std::string* path) { | |||
| 341 | 341 | ||
| 342 | 342 | // Check if a path looks like an absolute path or file URL. | |
| 343 | 343 | bool IsAbsoluteFilePath(std::string_view path) { | |
| 344 | - if (path.rfind("file://", 0) == 0) { | ||
| 344 | + if (path.starts_with("file://")) { | ||
| 345 | 345 | return true; | |
| 346 | 346 | } | |
| 347 | 347 | #ifdef _WIN32 | |
@@ -357,7 +357,7 @@ bool IsAbsoluteFilePath(std::string_view path) { | |||
| 357 | 357 | std::string NormalizeFileURLOrPath(Environment* env, std::string_view path) { | |
| 358 | 358 | std::string normalized_string(path); | |
| 359 | 359 | constexpr std::string_view file_scheme = "file://"; | |
| 360 | - if (normalized_string.rfind(file_scheme, 0) == 0) { | ||
| 360 | + if (normalized_string.starts_with(file_scheme)) { | ||
| 361 | 361 | auto out = ada::parse<ada::url_aggregator>(normalized_string); | |
| 362 | 362 | auto file_path = url::FileURLToPath(env, *out); | |
| 363 | 363 | if (!file_path.has_value()) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments