File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -206,9 +206,15 @@ void file_scanner_<LoggerPolicy>::finalize(uint32_t& inode_num) {
206
206
if (auto it = by_hash_.find (p->hash ()); it != by_hash_.end ()) {
207
207
return it->second ;
208
208
}
209
- auto it = file_start_hash_.find (p);
210
- uint64_t hash = it != file_start_hash_.end () ? it->second : 0 ;
211
- return unique_size_.at ({p->size (), hash});
209
+ auto const size = p->size ();
210
+ uint64_t hash{0 };
211
+ if (size >= kLargeFileThreshold ) [[unlikely]] {
212
+ auto it = file_start_hash_.find (p);
213
+ DWARFS_CHECK (it != file_start_hash_.end (),
214
+ " internal error: missing start hash for large file" );
215
+ hash = it->second ;
216
+ }
217
+ return unique_size_.at ({size, hash});
212
218
});
213
219
finalize_files<true >(unique_size_, inode_num, obj_num);
214
220
finalize_files (by_raw_inode_, inode_num, obj_num);
You can’t perform that action at this time.
0 commit comments