Skip to content

Commit d06fd5e

Browse files
committed
[indexing] only check for dupes if the scan is complete
Related to #1531
1 parent 6387071 commit d06fd5e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/lnav.indexing.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ rebuild_indexes(std::optional<ui_clock::time_point> deadline)
346346
scroll_downs[LNV_LOG] = false;
347347
}
348348

349-
{
349+
if (retval.rir_completed && !retval.rir_rescan_needed) {
350350
std::unordered_map<std::string, std::list<std::shared_ptr<logfile>>>
351351
id_to_files;
352352
auto reload = false;
@@ -367,7 +367,7 @@ rebuild_indexes(std::optional<ui_clock::time_point> deadline)
367367
return right->get_stat().st_size < left->get_stat().st_size;
368368
});
369369

370-
auto dupe_name = lf.front()->get_unique_path();
370+
const auto& dupe_name = lf.front()->get_unique_path();
371371
lf.pop_front();
372372
std::for_each(
373373
lf.begin(), lf.end(), [&dupe_name, &reload](auto& lf) {

0 commit comments

Comments
 (0)