Remove running truncation code twice

Summary: D16096960 accidentally caused the truncation code to be run twice (once inline and once via a function code), this shouldn't cause any difference in outcome but is unnecessary.

Reviewed By: strager

Differential Revision: D16508798

fbshipit-source-id: 12781aee98e70e5105c5476d29cf5cdd1e31062d
This commit is contained in:
Jake Crouch 2019-07-27 16:43:31 -07:00 committed by Facebook Github Bot
parent b998c78386
commit 36696fe637

View File

@ -90,13 +90,6 @@ void Journal::addDelta(std::unique_ptr<JournalDelta>&& delta) {
// Check memory before adding the new delta to make sure we always
// have at least one delta (other than when the journal starts up)
while (!deltaState->deltas.empty() && deltaState->stats &&
deltaState->stats->memoryUsage > deltaState->memoryLimit) {
deltaState->stats->entryCount--;
deltaState->stats->memoryUsage -=
deltaState->deltas.front().estimateMemoryUsage();
deltaState->deltas.pop_front();
}
truncateIfNecessary(deltaState);
// We will compact the delta if possible. We can compact the delta if it is