diff options
| author | Fangrui Song <maskray@google.com> | 2019-04-21 06:17:40 +0000 | 
|---|---|---|
| committer | Fangrui Song <maskray@google.com> | 2019-04-21 06:17:40 +0000 | 
| commit | a0f9c4f72c80cf23cda59cd6d3161a4992370078 (patch) | |
| tree | 40c59fc592bce9404ca375ed15aedec04283cae2 | |
| parent | 70961f17efdf389e711b261fbaa722b00f9f7768 (diff) | |
| download | bcm5719-llvm-a0f9c4f72c80cf23cda59cd6d3161a4992370078.tar.gz bcm5719-llvm-a0f9c4f72c80cf23cda59cd6d3161a4992370078.zip  | |
[CachePruning] Simplify comparator
llvm-svn: 358843
| -rw-r--r-- | llvm/lib/Support/CachePruning.cpp | 11 | 
1 files changed, 2 insertions, 9 deletions
diff --git a/llvm/lib/Support/CachePruning.cpp b/llvm/lib/Support/CachePruning.cpp index 7f97d1afbd3..9813eec0e43 100644 --- a/llvm/lib/Support/CachePruning.cpp +++ b/llvm/lib/Support/CachePruning.cpp @@ -35,15 +35,8 @@ struct FileInfo {    /// Used to determine which files to prune first. Also used to determine    /// set membership, so must take into account all fields.    bool operator<(const FileInfo &Other) const { -    if (Time < Other.Time) -      return true; -    else if (Other.Time < Time) -      return false; -    if (Other.Size < Size) -      return true; -    else if (Size < Other.Size) -      return false; -    return Path < Other.Path; +    return std::tie(Time, Other.Size, Path) < +           std::tie(Other.Time, Size, Other.Path);    }  };  } // anonymous namespace  | 

