diff --git a/lib/std/ascii.zig b/lib/std/ascii.zig index 7b99f6f4cf7cb608a7abe5c74c280f37b72bbf39..6f466e0a6af5a2780d56f17828ddb00f94a1625a 100644 --- a/lib/std/ascii.zig +++ b/lib/std/ascii.zig @@ -135,10 +135,10 @@ pub fn isPrint(c: u8) bool { /// Returns whether this character is included in `whitespace`. pub fn isWhitespace(c: u8) bool { - return for (whitespace) |other| { - if (c == other) - break true; - } else false; + return switch (c) { + ' ', '\t'...'\r' => true, + else => false, + }; } /// Whitespace for general use.