1
0
Fork 0
mirror of https://github.com/sbrl/Nibriboard.git synced 2018-01-10 21:33:49 +00:00

[client] Add debug method to clear the requested chunks from the chunk cache.

This commit is contained in:
Starbeamrainbowlabs 2017-12-15 20:05:53 +00:00
parent ea4a8b9b15
commit 9fa7a04d47
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -70,6 +70,14 @@ class ChunkCache
return lineFragments;
}
clearRequestedChunks()
{
for(let [chunkRefStr, chunk] of this.cache.entries()) {
if(!(chunk instanceof Chunk))
this.cache.delete(chunkRefStr);
}
}
/**
* Adds the given chunk to the chunk cache.
* @param {Chunk} chunkData The chunk to add to the cache.