File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ BuiltinLoader::BuiltinCategories BuiltinLoader::GetBuiltinCategories() const {
169169 if (prefix.length () > id.length ()) {
170170 continue ;
171171 }
172- if (id.find (prefix) == 0 &&
172+ if (id.starts_with (prefix) &&
173173 builtin_categories.can_be_required .count (id) == 0 ) {
174174 builtin_categories.cannot_be_required .emplace (id);
175175 }
Original file line number Diff line number Diff line change @@ -341,7 +341,7 @@ void FromNamespacedPath(std::string* path) {
341341
342342// Check if a path looks like an absolute path or file URL.
343343bool IsAbsoluteFilePath (std::string_view path) {
344- if (path.rfind (" file://" , 0 ) == 0 ) {
344+ if (path.starts_with (" file://" ) ) {
345345 return true ;
346346 }
347347#ifdef _WIN32
@@ -357,7 +357,7 @@ bool IsAbsoluteFilePath(std::string_view path) {
357357std::string NormalizeFileURLOrPath (Environment* env, std::string_view path) {
358358 std::string normalized_string (path);
359359 constexpr std::string_view file_scheme = " file://" ;
360- if (normalized_string.rfind (file_scheme, 0 ) == 0 ) {
360+ if (normalized_string.starts_with (file_scheme) ) {
361361 auto out = ada::parse<ada::url_aggregator>(normalized_string);
362362 auto file_path = url::FileURLToPath (env, *out);
363363 if (!file_path.has_value ()) {
You can’t perform that action at this time.
0 commit comments