diff options
Diffstat (limited to 'core/ustring.h')
-rw-r--r-- | core/ustring.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/core/ustring.h b/core/ustring.h index 73537bfd13..1bb4719b85 100644 --- a/core/ustring.h +++ b/core/ustring.h @@ -279,6 +279,29 @@ struct NaturalNoCaseComparator { } }; +template <typename L, typename R> +_FORCE_INLINE_ bool is_str_less(const L *l_ptr, const R *r_ptr) { + + while (true) { + + if (*l_ptr == 0 && *r_ptr == 0) + return false; + else if (*l_ptr == 0) + return true; + else if (*r_ptr == 0) + return false; + else if (*l_ptr < *r_ptr) + return true; + else if (*l_ptr > *r_ptr) + return false; + + l_ptr++; + r_ptr++; + } + + CRASH_COND(true); // unreachable +} + /* end of namespace */ //tool translate |