We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 16a1677 commit 3f7e98cCopy full SHA for 3f7e98c
src/url.zig
@@ -153,18 +153,11 @@ pub const URL = struct {
153
std.debug.assert(out[out_i - 1] == '/');
154
155
out_i -= 2;
156
- while (out_i > 1) {
157
- const next = out_i - 1;
158
- if (out[next] == '/') {
159
- // <= to deal with the hack-ish protocol_end which will be
160
- // off-by-one between http and https
161
- if (out_i <= protocol_end) {
162
- return error.InvalidURL;
163
- }
164
- break;
165
166
- out_i = next;
+ while (out_i > 1 and out[out_i - 1] != '/') {
+ out_i -= 1;
167
}
+ // <= to deal with the hack-ish protocol_end which will be off-by-one between http and https
+ if (out_i <= protocol_end) return error.InvalidURL;
168
in_i += 3;
169
continue;
170
0 commit comments