Skip to content

Commit 093f947

Browse files
[CAS] Fix wrong usage of llvm::sort() in UnifiedOnDiskCache (#166963)
Fix compare function in getAllDBDirs(). The compare function in sort should be strictly less than operator.
1 parent a7c0e78 commit 093f947

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/CAS/UnifiedOnDiskCache.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ getAllDBDirs(StringRef Path, bool IncludeCorrupt = false) {
174174
return createFileError(Path, EC);
175175

176176
llvm::sort(FoundDBDirs, [](const DBDir &LHS, const DBDir &RHS) -> bool {
177-
return LHS.Order <= RHS.Order;
177+
return LHS.Order < RHS.Order;
178178
});
179179

180180
SmallVector<std::string, 4> DBDirs;

0 commit comments

Comments
 (0)