@@ -288,7 +288,9 @@ class UniversalCompactionBuilder {
288
288
// and the index of the file in that level
289
289
290
290
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) {}
292
294
293
295
FileMetaData* f;
294
296
size_t level;
@@ -321,22 +323,14 @@ SmallestKeyHeap create_level_heap(Compaction* c, const Comparator* ucmp) {
321
323
SmallestKeyHeap smallest_key_priority_q =
322
324
SmallestKeyHeap (SmallestKeyHeapComparator (ucmp));
323
325
324
- InputFileInfo input_file;
325
-
326
326
for (size_t l = 0 ; l < c->num_input_levels (); l++) {
327
327
if (c->num_input_files (l) != 0 ) {
328
328
if (l == 0 && c->start_level () == 0 ) {
329
329
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);
334
331
}
335
332
} 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 );
340
334
}
341
335
}
342
336
}
0 commit comments