Skip to content

C#: Respect order of LGTM_INDEX_FILTERS in buildless extraction #15325

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

Merged
merged 3 commits into from
Jan 16, 2024

Conversation

RasmusWL
Copy link
Member

That is, using exclude:**/*\ninclude:**/* should include everything (but that wouldn't happen with the old code)

That is, using `exclude:**/*\ninclude:**/*` should include everything.
@RasmusWL RasmusWL requested a review from a team as a code owner January 15, 2024 10:47
@github-actions github-actions bot added the C# label Jan 15, 2024
mbg
mbg previously approved these changes Jan 15, 2024
Comment on lines +82 to +84
for (int i = pathFilters.Count - 1; i >= 0; i--)
{
var pathFilter = pathFilters[i];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: I wonder if pathFilters.Reverse() or foreach (var pathFilter in pathFilters.Reverse<PathFilter>()) would be clearer, rather than switching to indices.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually looked on stackoverflow for this, which said that using the inline .Reverse in the foreach was quite inefficient.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure off the top of my head if having the .Reverse in the foreach would get evaluated with every iteration, but replacing pathFilters.Sort with pathFilters.Reverse should at least be more efficient than .Sort (although likely not as efficient as using the indices of course).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can swap the reverse loop with a Reverse() on the list if you like. Personally I've seen enough reverse iterations of lists with explicit indexing that it just clicks 🤷

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't feel strongly about this, so feel free to just leave it as is 👍🏻

Co-authored-by: Michael B. Gale <mbg@github.com>
Copy link
Contributor

@tamasvajk tamasvajk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you.

@RasmusWL RasmusWL merged commit 6f45de1 into github:main Jan 16, 2024
@RasmusWL RasmusWL deleted the c#-filter-order branch January 16, 2024 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy