3 ms·
Decomposing things just to have different equality notions doesn't generalize. How would you decompose a character string so that you could have a case-insensi
by kazinator 11mo ago
Decomposing things just to have different equality notions doesn't generalize.
How would you decompose a character string so that you could have a case-insensitive versus sensitive comparison?
:)
- Nevermark 11mo ago> How would you decompose a character string With a capitalization bit mask of course! And you can speed up full equality comparisons with a quick cap equality check first. (That is the how. The when is probably "never". :)
- Rygian 11mo agoDon't forget to store the locale used for capitalization, too.
- stouset 11mo agoRight, I did note that this decomposition isn’t always applicable. But it often is, and you should default to that when possible.