Apply the same optimization to InetPathFormat.encodeSegment.
This commit is contained in:
parent
4bb5fc9ce8
commit
dc0fe5ad73
|
@ -1881,15 +1881,13 @@ struct InetPathFormat {
|
|||
import std.array : appender;
|
||||
|
||||
foreach (i, char c; segment) {
|
||||
if (isAsciiAlphaNum(c)) continue;
|
||||
switch (c) {
|
||||
default:
|
||||
auto ret = appender!string;
|
||||
ret.put(segment[0 .. i]);
|
||||
encodeSegment(ret, segment[i .. $]);
|
||||
return ret.data;
|
||||
case 'a': .. case 'z':
|
||||
case 'A': .. case 'Z':
|
||||
case '0': .. case '9':
|
||||
case '-', '.', '_', '~':
|
||||
case '!', '$', '&', '\'', '(', ')', '*', '+', ',', ';', '=':
|
||||
case ':', '@':
|
||||
|
|
Loading…
Reference in a new issue