mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[NaturalComparer] Add "number length" fix
This commit is contained in:
@@ -87,6 +87,12 @@ namespace NaturalSort
|
|||||||
return Style.CompareNumeric(left, right);
|
return Style.CompareNumeric(left, right);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If we have an equal part, then make sure that "longer" ones are taken into account
|
||||||
|
if (x.CompareTo(y) == 0)
|
||||||
|
{
|
||||||
|
return left.Length - right.Length;
|
||||||
|
}
|
||||||
|
|
||||||
return x.CompareTo(y);
|
return x.CompareTo(y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,6 +87,12 @@ namespace NaturalSort
|
|||||||
return Style.CompareNumeric(right, left);
|
return Style.CompareNumeric(right, left);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If we have an equal part, then make sure that "longer" ones are taken into account
|
||||||
|
if (y.CompareTo(x) == 0)
|
||||||
|
{
|
||||||
|
return right.Length - left.Length;
|
||||||
|
}
|
||||||
|
|
||||||
return y.CompareTo(x);
|
return y.CompareTo(x);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user