mirror of
https://github.com/samsonjs/media.git
synced 2026-03-28 09:55:48 +00:00
Make removal of non-existent cache span a no-op
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=155413733
This commit is contained in:
parent
1d6816d94b
commit
51132f58f9
1 changed files with 3 additions and 1 deletions
|
|
@ -286,7 +286,9 @@ public final class SimpleCache implements Cache {
|
|||
|
||||
private void removeSpan(CacheSpan span, boolean removeEmptyCachedContent) throws CacheException {
|
||||
CachedContent cachedContent = index.get(span.key);
|
||||
Assertions.checkState(cachedContent.removeSpan(span));
|
||||
if (cachedContent == null || !cachedContent.removeSpan(span)) {
|
||||
return;
|
||||
}
|
||||
totalSpace -= span.length;
|
||||
if (removeEmptyCachedContent && cachedContent.isEmpty()) {
|
||||
index.removeEmpty(cachedContent.key);
|
||||
|
|
|
|||
Loading…
Reference in a new issue