equal
deleted
inserted
replaced
37 |
37 |
38 private static final int CHAR_START = 0; |
38 private static final int CHAR_START = 0; |
39 private static final int CHAR_LIMIT = 0x110000; |
39 private static final int CHAR_LIMIT = 0x110000; |
40 |
40 |
41 private static int cache = 0; |
41 private static int cache = 0; |
42 public static final int getScript(int cp) { |
42 public static int getScript(int cp) { |
43 // optimize for runs of characters in the same script |
43 // optimize for runs of characters in the same script |
44 if (cp >= data[cache] && cp < data[cache+2]) { |
44 if (cp >= data[cache] && cp < data[cache+2]) { |
45 return data[cache+1]; |
45 return data[cache+1]; |
46 } |
46 } |
47 if (cp >= CHAR_START & cp < CHAR_LIMIT) { |
47 if (cp >= CHAR_START & cp < CHAR_LIMIT) { |