1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

optimize a in [1,2,3] to a == 1 || a == 2 || a == 3

This commit is contained in:
Alexander Medvednikov
2019-10-06 04:27:29 +03:00
parent 62133c6ffa
commit b242e8d7ff
4 changed files with 59 additions and 8 deletions

View File

@@ -629,12 +629,8 @@ pub fn (a []string) to_c() voidptr {
}
*/
fn is_space(c byte) bool {
return c in [` `,`\n`,`\t`,`\v`,`\f`,`\r`]
}
pub fn (c byte) is_space() bool {
return is_space(c)
return c in [` `,`\n`,`\t`,`\v`,`\f`,`\r`]
}
pub fn (s string) trim_space() string {