[outdated] strcmp, or a proper operator < on strings
Operator < on strings in ESO-Lua ignores everything except letters and digits. It's useless for sorting strings containing spaces and/or punctuation, as it doesn't define a total order.
Examples: Lua Code:
|
I assume the sorting is based on type, then the order with base 36 as next
0123456789abcdefghijklmnopqrstuvwxyz, if they are equal then sorting is based on case ? comparing other values would likely produce a nil value as it can't convert it to a number for comaprison, which leads to a nil, which leads to type inequality, which leads to false, if it all makes sense somehow "a head" < "ahead" == false --> nil < 17607829 "ahead" < "a head" == false --> 17607829 < nil Anyways, it looks weird :P aa == 370 -> (36^1)*10 + (36^0)*10 aaa == 13330 -> (36^2)*10 + aa and so on ... |
Quote:
http://www.lua.org/source/5.1/lvm.c.html#luaV_lessthan Strings are compared using strcoll: http://www.lua.org/source/5.1/lvm.c.html#l_strcmp What we have in ESO is some custom-made string comparison. Perhaps it supports multi-byte UTF-8 characters, I haven't checked that. It doesn't support ASCII punctuation, that's broken enough in my eyes ;) |
All times are GMT -6. The time now is 02:43 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI