Skip to content

Commit

Permalink
ICU-13640 Merging the removal of Unified Cache Asserts (r41145) to ma…
Browse files Browse the repository at this point in the history
…int-61

X-SVN-Rev: 41146
  • Loading branch information
aheninger committed Mar 23, 2018
1 parent d718634 commit b3054b3
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions icu4c/source/common/unifiedcache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,13 +263,10 @@ UBool UnifiedCache::_flush(UBool all) const {
int32_t UnifiedCache::_computeCountOfItemsToEvict() const {
int32_t totalItems = uhash_count(fHashtable);
int32_t evictableItems = totalItems - fNumValuesInUse;
U_ASSERT(totalItems >= fNumValuesInUse);
U_ASSERT(totalItems >= evictableItems);

int32_t unusedLimitByPercentage = fNumValuesInUse * fMaxPercentageOfInUse / 100;
int32_t unusedLimit = std::max(unusedLimitByPercentage, fMaxUnused);
int32_t countOfItemsToEvict = std::max(0, evictableItems - unusedLimit);
U_ASSERT(countOfItemsToEvict >= 0 && countOfItemsToEvict <= evictableItems);
return countOfItemsToEvict;
}

Expand Down

0 comments on commit b3054b3

Please sign in to comment.