Skip to content

Commit

Permalink
Do not rely on ADL when invoking std::max_element (#9608)
Browse files Browse the repository at this point in the history
Summary:
Certain STLs use raw pointers and ADL does not work for them.

Pull Request resolved: facebook/rocksdb#9608

Reviewed By: ajkr

Differential Revision: D34583012

Pulled By: riversand963

fbshipit-source-id: 7de6bbc8a080c3e7243ce0d758fe83f1663168aa
  • Loading branch information
georgthegreat authored and ajkr committed Mar 29, 2022
1 parent 9622795 commit 076ac98
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions db/external_sst_file_ingestion_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -777,10 +777,11 @@ Status ExternalSstFileIngestionJob::AssignLevelAndSeqnoForIngestedFile(
const std::vector<FileMetaData*>& level_files =
vstorage->LevelFiles(lvl);
const SequenceNumber level_largest_seqno =
(*max_element(level_files.begin(), level_files.end(),
[](FileMetaData* f1, FileMetaData* f2) {
return f1->fd.largest_seqno < f2->fd.largest_seqno;
}))
(*std::max_element(level_files.begin(), level_files.end(),
[](FileMetaData* f1, FileMetaData* f2) {
return f1->fd.largest_seqno <
f2->fd.largest_seqno;
}))
->fd.largest_seqno;
// should only assign seqno to current level's largest seqno when
// the file fits
Expand Down

0 comments on commit 076ac98

Please sign in to comment.