Skip to content

Commit 29a61c8

Browse files
dranikpgCopilot
andcommitted
Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Vladislav <vladislav.oleshko@gmail.com>
1 parent cfb6849 commit 29a61c8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/server/tiering/serialized_map.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ size_t SerializedMap::DataBytes() const {
5656
}
5757

5858
size_t SerializedMap::EstimateSize(size_t data_bytes, size_t entries) {
59-
return kLenBytes /* entry number */ + data_bytes + entries * 2 * kLenBytes /* string lenghts */;
59+
return kLenBytes /* entry number */ + data_bytes + entries * 2 * kLenBytes /* string lengths */;
6060
}
6161

6262
size_t SerializedMap::Serialize(const detail::ListpackWrap& lw, absl::Span<char> buffer) {

src/server/tiering/small_bins.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ size_t SmallBins::SerializeBin(FilledBin* bin, io::MutableBytes dest) {
7676

7777
// Steal backing array from bin if relevant
7878
if (current_bin_.entries.empty()) {
79-
bin->entries.erase(bin->entries.begin(), bin->entries.end()); // clear shrinks backing
79+
bin->entries.erase(bin->entries.begin(), bin->entries.end()); // erase doesn't shrink backing, so we can reuse the allocated capacity
8080
current_bin_.entries = std::move(bin->entries);
8181
}
8282

0 commit comments

Comments
 (0)