diff options
Diffstat (limited to 'srcs/juloo.keyboard2/ComposeKey.java')
| -rw-r--r-- | srcs/juloo.keyboard2/ComposeKey.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/srcs/juloo.keyboard2/ComposeKey.java b/srcs/juloo.keyboard2/ComposeKey.java index 57b2a4e..9571c03 100644 --- a/srcs/juloo.keyboard2/ComposeKey.java +++ b/srcs/juloo.keyboard2/ComposeKey.java @@ -46,13 +46,15 @@ public final class ComposeKey matched. */ public static KeyValue apply(int prev, String s) { + final int len = s.length(); int i = 0; + if (len == 0) return null; while (true) { KeyValue k = apply(prev, s.charAt(i)); i++; if (k == null) return null; - if (i >= s.length()) return k; + if (i >= len) return k; if (k.getKind() != KeyValue.Kind.Compose_pending) return null; // Found a final state before the end of [s]. prev = k.getPendingCompose(); |
