-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resources: ignore trailing slash when comparing #45772
Conversation
@isidorn do we know at which point do resources enter our system that have a trailing slash? I would think that the majority of users of these 2 methods will never have a trailing slash, is that a fair statement? |
Imho we should do the normalization at that point if possible. So far we never had trailing slashes ending up in our system because we |
Yeah, I would say wherever we accept and open URIs or paths this can happen and I believe that's OK to happen because the folder What I do think is a little naive and wasteful is the creation new strings all the time, you could embed the logic simply inside the |
For once, we should use
I believe they do... While indexOf === 0 and when it's not found it will do a substring of 0 which should be a noop. |
@jrieken I thought the browser |
What is needed for this PR so we proceed? |
@isidorn I would just add a check to see if |
@isidorn I think that's fair and everyone would benefit from it. With 06ba86f#diff-6483307f755ba6e74fda5c954b3d08f2 @bpasero deleted the tests and I would restore them. Also the way how the function is implemented seems to have changed overtime, esp. that the inputs aren't normalised anymore can be a problem. Think of |
fyi - That's the problem of our lib.d.ts and the endless IE11 story. The implementation tho could check that and export |
As far as I remember, Bottom line:
|
Both are called like crazy, one startup in a normal workspace (showing a full explorer), I count 1180 calls to Since a while (around two years) the So, I would recommend the following. Leave |
We have removed it from the most common hot-loop in explorer. However there are still some usages captured in this item #46549 |
...and #46103 |
Let's close in favor of #48682 |
fixes #36946
This time did it on resources. Makes more sense here as you said