Browse Source

string.h: bug fix on operator<

undefined
Guillaume Bittoun Sam Hocevar <sam@hocevar.net> 10 years ago
parent
commit
bfe68911d4
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      src/lol/base/string.h

+ 6
- 1
src/lol/base/string.h View File

@@ -279,7 +279,12 @@ public:
inline bool operator <(String const & s) const
{
using namespace std;
return memcmp(C(), s.C(), Count()) < 0;
int res = memcmp(C(), s.C(), Count() < s.Count() ? Count() : s.Count());

if (!res)
return Count() < s.Count();

return res < 0;
}

#ifdef __GNUC__


Loading…
Cancel
Save