diff options
| author | Jules Aguillon | 2022-06-06 00:23:45 +0200 |
|---|---|---|
| committer | Jules Aguillon | 2022-06-06 00:23:45 +0200 |
| commit | 31d6a70dfb9c7ad3a72302bca2339f926e4593ee (patch) | |
| tree | 18aacc302fb21472688c01c0f73b53662b61cd37 /srcs/juloo.keyboard2/Emoji.java | |
| parent | 7462955507325bf8f9037a45aec17c15b5f8b9e7 (diff) | |
| download | unexpected-keyboard-31d6a70dfb9c7ad3a72302bca2339f926e4593ee.tar.gz unexpected-keyboard-31d6a70dfb9c7ad3a72302bca2339f926e4593ee.zip | |
Refactor: Remove KeyValue.name
This makes KeyValue objects smaller. 'equals' and 'hashCode' are now
implemented too. Key names are still used to recognise keys with special
meaning, but not for comparing keys anymore.
Diffstat (limited to 'srcs/juloo.keyboard2/Emoji.java')
| -rw-r--r-- | srcs/juloo.keyboard2/Emoji.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/srcs/juloo.keyboard2/Emoji.java b/srcs/juloo.keyboard2/Emoji.java index 28c4f9f..2f00181 100644 --- a/srcs/juloo.keyboard2/Emoji.java +++ b/srcs/juloo.keyboard2/Emoji.java @@ -10,6 +10,7 @@ import java.util.HashMap; public class Emoji { + private final String _name; private final KeyValue _kv; private final String _desc; @@ -17,14 +18,15 @@ public class Emoji protected Emoji(String name, String bytecode, String desc) { - _kv = new KeyValue(name, bytecode, KeyValue.KIND_STRING, 0, 0); + _name = name; + _kv = new KeyValue(bytecode, KeyValue.KIND_STRING, 0, 0); _desc = desc; emojis_by_name.put(name, this); } public String name() { - return _kv.name; + return _name; } public KeyValue kv() |
