src/htmlindex/indexentry/operatorless.cc
raw| 1 | #include "../htmlindex.h" |
| 2 | |
| 3 | bool IndexEntry::operator<(IndexEntry const &other) const |
| 4 | { |
| 5 | if (isalnum(uppercaseKey[0]) && !isalnum(other.uppercaseKey[0])) |
| 6 | return false; // alphanumeric entries after special chars |
| 7 | |
| 8 | if (!isalnum(uppercaseKey[0]) && isalnum(other.uppercaseKey[0])) |
| 9 | return true; // special chars before alphanumeric entries |
| 10 | |
| 11 | return uppercaseKey < other.uppercaseKey; |
| 12 | } |