From dc0fe5ad73a35f7f68fc8f4ea961e44ef1b5467f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Mon, 18 Jan 2021 14:50:57 +0100 Subject: [PATCH] Apply the same optimization to InetPathFormat.encodeSegment. --- source/vibe/core/path.d | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/source/vibe/core/path.d b/source/vibe/core/path.d index 3944f24..093bb3a 100644 --- a/source/vibe/core/path.d +++ b/source/vibe/core/path.d @@ -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 ':', '@':