revert addition of valid word cache, fixes #307

This commit is contained in:
Helium314 2023-12-15 14:55:41 +01:00
parent 6453daf18e
commit 18aa209ee7
2 changed files with 2 additions and 7 deletions

View file

@ -89,7 +89,7 @@ public class DictionaryFacilitatorImpl implements DictionaryFacilitator {
new Class[] { Context.class, Locale.class, File.class, String.class, String.class };
// todo: write cache never set, and never read (only written)
// (initially was the same for the read cache, why?)
// tried to use read cache for a while, but small performance improvements are not worth the work (https://github.com/Helium314/openboard/issues/307)
private LruCache<String, Boolean> mValidSpellingWordReadCache;
private LruCache<String, Boolean> mValidSpellingWordWriteCache;

View file

@ -6,16 +6,11 @@
package org.dslul.openboard.inputmethod.latin;
import android.util.LruCache;
/**
* Factory for instantiating DictionaryFacilitator objects.
*/
public class DictionaryFacilitatorProvider {
public static DictionaryFacilitator getDictionaryFacilitator(boolean isNeededForSpellChecking) {
final DictionaryFacilitator facilitator = new DictionaryFacilitatorImpl();
if (isNeededForSpellChecking)
facilitator.setValidSpellingWordReadCache(new LruCache<>(200));
return facilitator;
return new DictionaryFacilitatorImpl();
}
}