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
The current algorithm for case transformation doesn't perform any overhead to check any properties of the input string. Even if the operations don't make any changes, there are still some borrowing and cloning that happens are part of the conversion. There's improvements to be made in this regard, but in general I don't think the overhead of checking if it's already a case is worth the savings of not copying the string. I suspect most use cases of case conversion you explicitly know that a string isn't the right case, which is why you convert it. Is there a use case you are thinking of where this performance advantage would be substantial?
If a referenced
str
is already in requested case, is there any reason why it shouldn't be returned in borrowed view?The text was updated successfully, but these errors were encountered: