Skip to content

Commit 93328ff

Browse files
committed
Fix linter
1 parent a223b9e commit 93328ff

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

db/compaction/compaction_picker_universal.cc

+5-11
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,9 @@ class UniversalCompactionBuilder {
288288
// and the index of the file in that level
289289

290290
struct InputFileInfo {
291-
InputFileInfo() : f(nullptr), level(0), index(0) {}
291+
InputFileInfo() : InputFileInfo(nullptr, 0, 0) {}
292+
InputFileInfo(FileMetaData* file_meta, size_t l, size_t i)
293+
: f(file_meta), level(l), index(i) {}
292294

293295
FileMetaData* f;
294296
size_t level;
@@ -321,22 +323,14 @@ SmallestKeyHeap create_level_heap(Compaction* c, const Comparator* ucmp) {
321323
SmallestKeyHeap smallest_key_priority_q =
322324
SmallestKeyHeap(SmallestKeyHeapComparator(ucmp));
323325

324-
InputFileInfo input_file;
325-
326326
for (size_t l = 0; l < c->num_input_levels(); l++) {
327327
if (c->num_input_files(l) != 0) {
328328
if (l == 0 && c->start_level() == 0) {
329329
for (size_t i = 0; i < c->num_input_files(0); i++) {
330-
input_file.f = c->input(0, i);
331-
input_file.level = 0;
332-
input_file.index = i;
333-
smallest_key_priority_q.push(std::move(input_file));
330+
smallest_key_priority_q.emplace(c->input(0, i), 0, i);
334331
}
335332
} else {
336-
input_file.f = c->input(l, 0);
337-
input_file.level = l;
338-
input_file.index = 0;
339-
smallest_key_priority_q.push(std::move(input_file));
333+
smallest_key_priority_q.emplace(c->input(l, 0), l, 0);
340334
}
341335
}
342336
}

0 commit comments

Comments
 (0)