Avoid among switch-case jump table overhead for just two possible values.

This commit is contained in:
Sönke Ludwig 2021-01-19 10:29:24 +01:00
parent dc0fe5ad73
commit 246b5262c6

View file

@ -1303,8 +1303,7 @@ struct WindowsPathFormat {
static bool isSeparator(dchar ch) static bool isSeparator(dchar ch)
@nogc { @nogc {
import std.algorithm.comparison : among; return ch == '\\' || ch == '/';
return ch.among!('\\', '/') != 0;
} }
static string getAbsolutePrefix(string path) static string getAbsolutePrefix(string path)