From 31d6a70dfb9c7ad3a72302bca2339f926e4593ee Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Mon, 6 Jun 2022 00:23:45 +0200 Subject: 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. --- srcs/juloo.keyboard2/Emoji.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'srcs/juloo.keyboard2/Emoji.java') 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() -- cgit v1.2.3