summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2015-08-09 13:54:17 +0000
committerrubidium <rubidium@openttd.org>2015-08-09 13:54:17 +0000
commit562c26977012aa632a6067517939bc8f1fd72984 (patch)
tree9a0749ee7a48967c95a6113e7588b5413b29e7fe /src
parentd45969779d15c81339f89e156c2398760784a51d (diff)
downloadopenttd-562c26977012aa632a6067517939bc8f1fd72984.tar.xz
(svn r27377) -Codechange: use the pkg-config files of ICU as well. Since they are split into separate libraries it becomes possible to split RTL support for natural sorting, although the effect will be minimal
Diffstat (limited to 'src')
-rw-r--r--src/string.cpp15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/string.cpp b/src/string.cpp
index 377fb7f98..fd422ec63 100644
--- a/src/string.cpp
+++ b/src/string.cpp
@@ -575,20 +575,7 @@ int strnatcmp(const char *s1, const char *s2, bool ignore_garbage_at_front)
#ifdef WITH_ICU_SORT
if (_current_collator != NULL) {
UErrorCode status = U_ZERO_ERROR;
- int result;
-
- /* We want to use the new faster method for ICU 4.2 and higher. */
-#if U_ICU_VERSION_MAJOR_NUM > 4 || (U_ICU_VERSION_MAJOR_NUM == 4 && U_ICU_VERSION_MINOR_NUM >= 2)
- /* The StringPiece parameter gets implicitly constructed from the char *. */
- result = _current_collator->compareUTF8(s1, s2, status);
-#else /* The following for 4.0 and lower. */
- UChar buffer1[DRAW_STRING_BUFFER];
- u_strFromUTF8Lenient(buffer1, lengthof(buffer1), NULL, s1, -1, &status);
- UChar buffer2[DRAW_STRING_BUFFER];
- u_strFromUTF8Lenient(buffer2, lengthof(buffer2), NULL, s2, -1, &status);
-
- result = _current_collator->compare(buffer1, buffer2, status);
-#endif /* ICU version check. */
+ int result = _current_collator->compareUTF8(s1, s2, status);
if (U_SUCCESS(status)) return result;
}