-
Notifications
You must be signed in to change notification settings - Fork 0
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
updating APIs, removing obsolete API usage, fixing build warnings #35
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look at my proposition, please.
If you have any questions, don't hesitate to ask!
|
||
return GetWidgetsIdentifiers() | ||
.Where(id => allowedScopes.Any(scope => id.StartsWith(scope, StringComparison.OrdinalIgnoreCase))) | ||
.Where(id => allowedScopes.ToList().Exists(scope => id.StartsWith(scope, StringComparison.OrdinalIgnoreCase))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really want to cast allowedScopes
to List
in the lambda? Why don't we use it like this:
List<string> allowedScopes = ["Kentico.", "DancingGoat.General.", "DancingGoat.LandingPage." ];
return GetWidgetsIdentifiers()
.Where(id => allowedScopes.Exists(scope => id.StartsWith(scope, StringComparison.OrdinalIgnoreCase)))
.ToArray();```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, wouldn't be HashSet
more suitable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good point. Since a HashSet has constant-time complexity for lookups, your solution would be more efficient.
Just a heads up, I did a lot of this work already in #34 There is some project structured/config that was missing that I also added. |
Thank you for pointing that out! From my perspective, your merge request addresses all the issues I was targeting with this one. Therefore, it might make sense to close this MR and proceed with #34 instead. @Rumec |
All issues were already resolved. Closing this PR |
Motivation
86198608
Checklist
How to test
If manual testing is required, what are the steps?