mirror of https://github.com/Icinga/icinga2.git
Fix string_iless performance issue.
This commit is contained in:
parent
2e78899347
commit
3ffe8707ab
|
@ -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());
|
||||
|
||||
*/
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -42,4 +42,6 @@ typedef DWORD pid_t;
|
|||
#define I2_EXPORT __declspec(dllexport)
|
||||
#define I2_IMPORT __declspec(dllimport)
|
||||
|
||||
#define strcasecmp stricmp
|
||||
|
||||
#endif /* WIN32_H */
|
||||
|
|
Loading…
Reference in New Issue