You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In both version 1.1.1 and 1.2.0, the natural_sort algorithm is unable to properly (or consistently) sort an array such as the following:
%w(BALNOR2 CKNOR2 NOR2I NOR2 NOR3I NOR3 NOR4)
In the code:
sa, sb = a.to_s, b.to_s
if (sa.downcase <=> sb.downcase) == 0 then sa <=> sb
else
na, nb = check_regexp(sa, sb)
na <=> nb
end
When trying to compare NOR2 & NOR2I (or NOR3 & NOR3I), the check_regexp method removes the trailing 'I' character so that na, nb have the same value and the na <=> nb expression is 0 which is incorrect for sa <=> sb.
Thanks,
Doug
The text was updated successfully, but these errors were encountered:
In both version 1.1.1 and 1.2.0, the natural_sort algorithm is unable to properly (or consistently) sort an array such as the following:
%w(BALNOR2 CKNOR2 NOR2I NOR2 NOR3I NOR3 NOR4)
In the code:
sa, sb = a.to_s, b.to_s
if (sa.downcase <=> sb.downcase) == 0 then sa <=> sb
else
na, nb = check_regexp(sa, sb)
na <=> nb
end
When trying to compare NOR2 & NOR2I (or NOR3 & NOR3I), the check_regexp method removes the trailing 'I' character so that na, nb have the same value and the na <=> nb expression is 0 which is incorrect for sa <=> sb.
Thanks,
Doug
The text was updated successfully, but these errors were encountered: