Fix string_iless performance issue.

This commit is contained in:
Gunnar Beutner 2013-01-28 09:43:54 +01:00
parent 2e78899347
commit 3ffe8707ab
2 changed files with 10 additions and 0 deletions

View File

@ -124,8 +124,16 @@ struct string_iless : std::binary_function<String, String, bool>
{
bool operator()(const String& s1, const String& s2) const
{
return strcasecmp(s1.CStr(), s2.CStr()) < 0;
/* The "right" way would be to do this - however the
* overhead is _massive_ due to the repeated non-inlined
* function calls:
return lexicographical_compare(s1.Begin(), s1.End(),
s2.Begin(), s2.End(), boost::algorithm::is_iless());
*/
}
};

View File

@ -42,4 +42,6 @@ typedef DWORD pid_t;
#define I2_EXPORT __declspec(dllexport)
#define I2_IMPORT __declspec(dllimport)
#define strcasecmp stricmp
#endif /* WIN32_H */