diff options
author | Chad Rosier <mcrosier@apple.com> | 2013-06-27 20:19:13 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2013-06-27 20:19:13 +0000 |
commit | ecff07c897a6ac8718828678c2cd13b61a89e36c (patch) | |
tree | 5912ee9c0a155730a60630bd8be45e314a7073d9 /llvm | |
parent | 03255a1675a06aebe99b18e8d500d483e231fd51 (diff) | |
download | bcm5719-llvm-ecff07c897a6ac8718828678c2cd13b61a89e36c.tar.gz bcm5719-llvm-ecff07c897a6ac8718828678c2cd13b61a89e36c.zip |
Remove unnecessary conditional checks.
llvm-svn: 185096
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/include/llvm/TableGen/Record.h | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/llvm/include/llvm/TableGen/Record.h b/llvm/include/llvm/TableGen/Record.h index 63b72c8a738..a07898a955c 100644 --- a/llvm/include/llvm/TableGen/Record.h +++ b/llvm/include/llvm/TableGen/Record.h @@ -1782,30 +1782,28 @@ struct LessRecordRegister { for (size_t I = 0, E = LHSNumParts; I < E; I+=2) { std::pair<bool, StringRef> LHSPart = LHSParts.getPart(I); std::pair<bool, StringRef> RHSPart = RHSParts.getPart(I); - if ((I & 1) == 0) { // Expect even part to always be alpha. - assert (LHSPart.first == false && RHSPart.first == false && - "Expected both parts to be alpha."); - if (int Res = LHSPart.second.compare(RHSPart.second)) - return Res < 0; - } + // Expect even part to always be alpha. + assert (LHSPart.first == false && RHSPart.first == false && + "Expected both parts to be alpha."); + if (int Res = LHSPart.second.compare(RHSPart.second)) + return Res < 0; } for (size_t I = 1, E = LHSNumParts; I < E; I+=2) { std::pair<bool, StringRef> LHSPart = LHSParts.getPart(I); std::pair<bool, StringRef> RHSPart = RHSParts.getPart(I); - if (I & 1) { // Expect odd part to always be numeric. - assert (LHSPart.first == true && RHSPart.first == true && - "Expected both parts to be numeric."); - if (LHSPart.second.size() != RHSPart.second.size()) - return LHSPart.second.size() < RHSPart.second.size(); - - unsigned LHSVal, RHSVal; - if (LHSPart.second.getAsInteger(10, LHSVal)) - assert("Unable to convert LHS to integer."); - if (RHSPart.second.getAsInteger(10, RHSVal)) - assert("Unable to convert RHS to integer."); - if (LHSVal != RHSVal) - return LHSVal < RHSVal; - } + // Expect odd part to always be numeric. + assert (LHSPart.first == true && RHSPart.first == true && + "Expected both parts to be numeric."); + if (LHSPart.second.size() != RHSPart.second.size()) + return LHSPart.second.size() < RHSPart.second.size(); + + unsigned LHSVal, RHSVal; + if (LHSPart.second.getAsInteger(10, LHSVal)) + assert("Unable to convert LHS to integer."); + if (RHSPart.second.getAsInteger(10, RHSVal)) + assert("Unable to convert RHS to integer."); + if (LHSVal != RHSVal) + return LHSVal < RHSVal; } return LHSNumParts < RHSNumParts; } |