@@ -96,13 +96,11 @@ ada_really_inline std::optional<std::string_view> prune_hash(
9696
9797ada_really_inline bool shorten_path (std::string& path,
9898 ada::scheme::type type) noexcept {
99- size_t first_delimiter = path.find_first_of (' /' , 1 );
100-
10199 // Let path be url's path.
102100 // If url's scheme is "file", path's size is 1, and path[0] is a normalized
103101 // Windows drive letter, then return.
104102 if (type == ada::scheme::type::FILE &&
105- first_delimiter == std::string_view::npos && !path.empty ()) {
103+ path. find ( ' / ' , 1 ) == std::string_view::npos && !path.empty ()) {
106104 if (checkers::is_normalized_windows_drive_letter (
107105 helpers::substring (path, 1 ))) {
108106 return false ;
@@ -121,13 +119,11 @@ ada_really_inline bool shorten_path(std::string& path,
121119
122120ada_really_inline bool shorten_path (std::string_view& path,
123121 ada::scheme::type type) noexcept {
124- size_t first_delimiter = path.find_first_of (' /' , 1 );
125-
126122 // Let path be url's path.
127123 // If url's scheme is "file", path's size is 1, and path[0] is a normalized
128124 // Windows drive letter, then return.
129125 if (type == ada::scheme::type::FILE &&
130- first_delimiter == std::string_view::npos && !path.empty ()) {
126+ path. find ( ' / ' , 1 ) == std::string_view::npos && !path.empty ()) {
131127 if (checkers::is_normalized_windows_drive_letter (
132128 helpers::substring (path, 1 ))) {
133129 return false ;
@@ -150,11 +146,7 @@ ada_really_inline void remove_ascii_tab_or_newline(
150146 std::string& input) noexcept {
151147 // if this ever becomes a performance issue, we could use an approach similar
152148 // to has_tabs_or_newline
153- input.erase (std::remove_if (input.begin (), input.end (),
154- [](char c) {
155- return ada::unicode::is_ascii_tab_or_newline (c);
156- }),
157- input.end ());
149+ std::erase_if (input, ada::unicode::is_ascii_tab_or_newline);
158150}
159151
160152ada_really_inline constexpr std::string_view substring (std::string_view input,
0 commit comments