diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-12-03 15:47:49 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2021-12-03 15:47:49 +0000 |
commit | 973879559cdd2fb1d14682a23bb58914471cff54 (patch) | |
tree | 7fe6e9c3e85265e01f43727b7754712087e770e0 | |
parent | ad4219f3c80db0f4448f7028757cd75b7c4028f0 (diff) |
Iterate outside of the loop
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/docsummary/summarycompacttarget.cpp | 4 | ||||
-rw-r--r-- | searchlib/src/vespa/searchlib/docstore/writeablefilechunk.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/docsummary/summarycompacttarget.cpp b/searchcore/src/vespa/searchcore/proton/docsummary/summarycompacttarget.cpp index 6d71b81cb8b..4e0cf3f9059 100644 --- a/searchcore/src/vespa/searchcore/proton/docsummary/summarycompacttarget.cpp +++ b/searchcore/src/vespa/searchcore/proton/docsummary/summarycompacttarget.cpp @@ -56,8 +56,8 @@ SummaryCompactTarget::getApproxMemoryGain() const IFlushTarget::DiskGain SummaryCompactTarget::getApproxDiskGain() const { - uint64_t total(_docStore.getDiskFootprint()); - return DiskGain(total, total - std::min(total, static_cast<uint64_t>(_docStore.getMaxCompactGain()))); + size_t total(_docStore.getDiskFootprint()); + return DiskGain(total, total - std::min(total, _docStore.getMaxCompactGain())); } IFlushTarget::Time diff --git a/searchlib/src/vespa/searchlib/docstore/writeablefilechunk.cpp b/searchlib/src/vespa/searchlib/docstore/writeablefilechunk.cpp index 2c0d10abd33..8c76a4477f5 100644 --- a/searchlib/src/vespa/searchlib/docstore/writeablefilechunk.cpp +++ b/searchlib/src/vespa/searchlib/docstore/writeablefilechunk.cpp @@ -483,11 +483,11 @@ WriteableFileChunk::writeData(const ProcessedChunkQ & chunks, size_t sz) void WriteableFileChunk::updateChunkInfo(const ProcessedChunkQ & chunks, const ChunkMetaV & cmetaV, size_t sz) { - std::lock_guard guard(_lock); uint32_t maxChunkId(0); for (const auto & chunk : chunks) { maxChunkId = std::max(chunk->getChunkId(), maxChunkId); } + std::lock_guard guard(_lock); if (maxChunkId >= _chunkInfo.size()) { _chunkInfo.reserve(vespalib::roundUp2inN(maxChunkId+1)); } |