[llvm] r233467 - Fix comparison functions.

Richard Trieu rtrieu at google.com
Fri Mar 27 19:37:33 PDT 2015


Author: rtrieu
Date: Fri Mar 27 21:37:33 2015
New Revision: 233467

URL: http://llvm.org/viewvc/llvm-project?rev=233467&view=rev
Log:
Fix comparison functions.

Modified:
    llvm/trunk/include/llvm/MC/MCContext.h

Modified: llvm/trunk/include/llvm/MC/MCContext.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCContext.h?rev=233467&r1=233466&r2=233467&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCContext.h (original)
+++ llvm/trunk/include/llvm/MC/MCContext.h Fri Mar 27 21:37:33 2015
@@ -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;
       }





More information about the llvm-commits mailing list