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
Just reading the code, I wonder if you mean this code in isense.ts...
// Case insensitive sorting
function caseInsensitiveSort(a: { name: string; }, b: { name: string; }) {
if (a.name.toLowerCase() < b.name.toLowerCase()) return -1;
if (a.name.toLowerCase() > b.name.toLowerCase()) return 1;
return 0;
}
To be more like this..
// Case insensitive sorting
function caseInsensitiveSort(a: { name: string; }, b: { name: string; }) {
if (a.name.toLowerCase() < b.name.toLowerCase()) return -1;
if (a.name.toLowerCase() > b.name.toLowerCase()) return 1;
// the lower-case strings are equal, so now put them in local order..
if (a.name < b.name) return -1;
if (a.name > b.name) return 1;
return 0;
}
This code will cause strings which different only in case to be adjacent to eachother, but in a deterministic way without collisions.
The text was updated successfully, but these errors were encountered:
Just reading the code, I wonder if you mean this code in isense.ts...
// Case insensitive sorting
function caseInsensitiveSort(a: { name: string; }, b: { name: string; }) {
if (a.name.toLowerCase() < b.name.toLowerCase()) return -1;
if (a.name.toLowerCase() > b.name.toLowerCase()) return 1;
return 0;
}
To be more like this..
// Case insensitive sorting
function caseInsensitiveSort(a: { name: string; }, b: { name: string; }) {
if (a.name.toLowerCase() < b.name.toLowerCase()) return -1;
if (a.name.toLowerCase() > b.name.toLowerCase()) return 1;
// the lower-case strings are equal, so now put them in local order..
if (a.name < b.name) return -1;
if (a.name > b.name) return 1;
return 0;
}
This code will cause strings which different only in case to be adjacent to eachother, but in a deterministic way without collisions.
The text was updated successfully, but these errors were encountered: