Skip to content
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

Closed
wants to merge 5 commits into from

Conversation

jiri-malec
Copy link
Collaborator

@jiri-malec jiri-malec commented Nov 27, 2024

Motivation

  • Fixes issue 86198608
  • Removing obsolete API, upgrading API references, removing additional build warnings

Checklist

  • Code follows coding conventions held in this repo
  • Automated tests have been added
  • Tests are passing
  • Docs have been updated (if applicable)
  • Temporary settings (e.g. variables used during development and testing) have been reverted to defaults

How to test

If manual testing is required, what are the steps?

@jiri-malec jiri-malec self-assigned this Nov 27, 2024
Copy link
Contributor

@Rumec Rumec left a 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)))
Copy link
Contributor

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();```

Copy link
Contributor

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?

Copy link
Collaborator Author

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.

@seangwright
Copy link
Member

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.

@jiri-malec
Copy link
Collaborator Author

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

@jiri-malec
Copy link
Collaborator Author

All issues were already resolved. Closing this PR

@jiri-malec jiri-malec closed this Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants