-
Notifications
You must be signed in to change notification settings - Fork 747
Cache RegEx in ValueMatchFilter #4056
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
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.
Nicely done, thanks @manfred-brands !
Very minor nitpick suggestion related to pre-initializing the and/or filters, but it's also fine to merge as-is too. Thanks!
@@ -156,15 +156,15 @@ public static TestFilter FromXml(TNode node) | |||
{ | |||
case "filter": | |||
case "and": | |||
List<TestFilter> childFilters = new List<TestFilter>(); | |||
var childFilters = new List<TestFilter>(node.ChildNodes.Count); |
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.
Nice touch to pre-initialize this. Thanks!
nitpick: Since we have to convert it to an array a few lines below, would it make sense to make this an array here instead of a list to save an array copy operation? Similar suggest for the "or" below.
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.
I agree with your nitpick, I should have looked how the list was used after.
Changed code to create array, extracted to a function so I only needed one copy.
@stevenaw Can you look at |
Thanks for noticing this 😊 I agree, it looks unused and appears to have been that way since a beta of nunit 3. That predates my involvement in the project, however, so I'd appreciate a second opinion. @CharliePoole any concerns with removing the code? |
@stevenaw The commenting out was part of a fairly large change I made back in 2015. The idea was that we were going to re-visit the question of how we wanted top-level selected tests (those actually selected by the user) and My 2 cents: If you find that Explicit is now working the way you want it to work (and/or as it's documented to work) I'd remove the property and all the commented out code that references it, possibly in a separate PR (but that's up to you guys). |
@stevenaw I will create a new issue and PR once this one is in to remove the TopLevel property. |
Sounds good, thanks @CharliePoole and @manfred-brands 👍 |
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.
LGTM. Thanks @manfred-brands ! |
Fixes #4055