|
1 | 1 | package de.peeeq.wurstscript.translation.imoptimizer; |
2 | 2 |
|
| 3 | +import io.vavr.collection.HashSet; |
| 4 | +import io.vavr.collection.Set; |
| 5 | + |
3 | 6 | public class RestrictedCompressedNames { |
4 | | - static String names[] = {"div", "val", "var", "mod", "use", "new", "for", "in", "it", "to", |
| 7 | + static Set<String> names = HashSet.of("div", "val", "var", "mod", "use", "new", "for", "in", "it", "to", |
5 | 8 | "Sin", "Cos", "Tan", "Pow", "I2R", "R2I", "I2S", "R2S", "S2I", "S2R", |
6 | 9 | "And", "Or", "Not", "or", "and", "not", "if", "set", "loop", "endif", |
7 | 10 | "endfunction", "endloop", "globals", "endglobals", "local", "call", "debug", |
8 | | - "main", "config", "alias"}; |
| 11 | + "main", "config", "alias"); |
9 | 12 |
|
10 | | - public static boolean contains(String s) { |
11 | | - for (String name : names) { |
12 | | - if (name.equals(s)) { |
13 | | - return true; |
14 | | - } |
15 | | - } |
16 | | - return false; |
| 13 | + public static boolean contains(String name) { |
| 14 | + return names.contains(name); |
17 | 15 | } |
18 | 16 | } |
0 commit comments