Utilize internal cache in StructureGrowthProcess (#371)

* Use whoPlacedCache

* Still perform database lookup if cache is empty

---------

Co-authored-by: Intelli <6790859+Intelli@users.noreply.github.com>
This commit is contained in:
violetc 2023-07-18 06:55:16 +08:00 committed by GitHub
parent 6045799fea
commit 2476aa2ea8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,10 @@ class StructureGrowthProcess {
Map<Integer, List<BlockState>> blockLists = Consumer.consumerBlockList.get(processId);
if (blockLists.get(id) != null) {
List<BlockState> blockStates = blockLists.get(id);
String resultData = Lookup.whoPlaced(statement, block);
String resultData = Lookup.whoPlacedCache(block);
if (resultData.isEmpty()) {
resultData = Lookup.whoPlaced(statement, block);
}
if (resultData.length() > 0) {
user = resultData;
}