Created
April 26, 2013 11:46
-
-
Save Habbie/5466872 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: misc.hh | |
=================================================================== | |
--- misc.hh (revision 3109) | |
+++ misc.hh (working copy) | |
@@ -311,16 +311,16 @@ | |
const unsigned char *aPtr = (const unsigned char*)a.c_str(), *bPtr = (const unsigned char*)b.c_str(); | |
int result; | |
+ if(aLen != bLen) | |
+ return true; // must differ | |
+ | |
for(n = 0 ; n < aLen && n < bLen ; ++n) { | |
if((result = dns_tolower(*aPtr++) - dns_tolower(*bPtr++))) { | |
- return result < 0; | |
+ return result < 0; // something differed | |
} | |
} | |
- if(n == aLen && n == bLen) // strings are equal (in length) | |
- return 0; | |
- if(n == aLen) // first string was shorter | |
- return true; | |
- return false; | |
+ | |
+ return false; // must be equal | |
} | |
inline bool pdns_iequals(const std::string& a, const std::string& b) __attribute__((pure)); | |
@@ -409,8 +409,6 @@ | |
{ | |
if(pdns_ilexicographical_compare(a.first, b.first)) | |
return true; | |
- if(pdns_ilexicographical_compare(b.first, a.first)) | |
- return false; | |
return a.second < b.second; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment