Parcourir la source

string.h: bug fix on operator<

undefined
Guillaume Bittoun Sam Hocevar <sam@hocevar.net> il y a 10 ans
Parent
révision
bfe68911d4
1 fichiers modifiés avec 6 ajouts et 1 suppressions
  1. +6
    -1
      src/lol/base/string.h

+ 6
- 1
src/lol/base/string.h Voir le fichier

@@ -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__


Chargement…
Annuler
Enregistrer