You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-12 13:20:55 +00:00
StringLikeVariantOrder: Compare in-place
This commit is contained in:
@@ -695,21 +695,13 @@ struct FileNoCaseComparator {
|
||||
};
|
||||
|
||||
template <typename L, typename R>
|
||||
_FORCE_INLINE_ bool is_str_less(const L *l_ptr, const R *r_ptr) {
|
||||
_FORCE_INLINE_ int64_t str_compare(const L *l_ptr, const R *r_ptr) {
|
||||
while (true) {
|
||||
const char32_t l = *l_ptr;
|
||||
const char32_t r = *r_ptr;
|
||||
|
||||
if (l == 0 && r == 0) {
|
||||
return false;
|
||||
} else if (l == 0) {
|
||||
return true;
|
||||
} else if (r == 0) {
|
||||
return false;
|
||||
} else if (l < r) {
|
||||
return true;
|
||||
} else if (l > r) {
|
||||
return false;
|
||||
if (l == 0 || l != r) {
|
||||
return static_cast<int64_t>(l) - static_cast<int64_t>(r);
|
||||
}
|
||||
|
||||
l_ptr++;
|
||||
|
||||
Reference in New Issue
Block a user