Revert "fix: hash all indexed keys"

This reverts commit 4a5daf2a8d.
This commit is contained in:
thecodrr
2020-11-16 15:00:24 +05:00
parent 20a3d1ab20
commit fd0d84b3ab
5 changed files with 14 additions and 21 deletions

View File

@@ -1,6 +1,5 @@
import Storage from "./storage";
import Indexer from "./indexer";
import SparkMD5 from "spark-md5";
export default class PersistentCachedMap {
/**
@@ -20,7 +19,6 @@ export default class PersistentCachedMap {
}
async set(key, value) {
key = SparkMD5.hash(key);
this.map.set(key, value);
await this.indexer.write(key, value);
await this.indexer.index(key);
@@ -33,12 +31,10 @@ export default class PersistentCachedMap {
}
get(key) {
key = SparkMD5.hash(key);
return this.map.get(key);
}
has(key) {
key = SparkMD5.hash(key);
return this.map.has(key);
}