Fix comparison functions.
authorRichard Trieu <rtrieu@google.com>
Sat, 28 Mar 2015 02:37:33 +0000 (02:37 +0000)
committerRichard Trieu <rtrieu@google.com>
Sat, 28 Mar 2015 02:37:33 +0000 (02:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233467 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/MC/MCContext.h

index 6f82d4f58cad881263fec2ee0fd1c2e66a3eaa15..ca4eae53a887bf11faf049662a926ccdec01a3bf 100644 (file)
@@ -168,8 +168,8 @@ namespace llvm {
       ELFSectionKey(StringRef SectionName, StringRef GroupName)
           : SectionName(SectionName), GroupName(GroupName) {}
       bool operator<(const ELFSectionKey &Other) const {
-        if (SectionName < Other.SectionName)
-          return true;
+        if (SectionName != Other.SectionName)
+          return SectionName < Other.SectionName;
         return GroupName < Other.GroupName;
       }
     };
@@ -183,9 +183,9 @@ namespace llvm {
           : SectionName(SectionName), GroupName(GroupName),
             SelectionKey(SelectionKey) {}
       bool operator<(const COFFSectionKey &Other) const {
-        if (SectionName < Other.SectionName)
-          return true;
-        if (GroupName < Other.GroupName)
+        if (SectionName != Other.SectionName)
+          return SectionName < Other.SectionName;
+        if (GroupName != Other.GroupName)
           return GroupName < Other.GroupName;
         return SelectionKey < Other.SelectionKey;
       }