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
While the code looks correct (because strippedName comes from stripSuffix and because of stripSuffix's contract and implementation), this is subtle enough that we should either add a test or use !=.
Since `String.equals` happens to be O(1) in this case, changing the code looks simpler. `String.equals` is O(1) here because it will either succeed by testing pointer equality or fail by noticing a length mismatch, so it will never look at the actual contents!
0 commit comments