-
Notifications
You must be signed in to change notification settings - Fork 162
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
src/opers.c: tweak and cleanup code; add tests #2296
src/opers.c: tweak and cleanup code; add tests #2296
Conversation
a84983e
to
045c704
Compare
Codecov Report
@@ Coverage Diff @@
## master #2296 +/- ##
==========================================
+ Coverage 56.67% 72.17% +15.5%
==========================================
Files 423 479 +56
Lines 223326 250961 +27635
==========================================
+ Hits 126575 181138 +54563
+ Misses 96751 69823 -26928
|
045c704
to
295c12f
Compare
src/opers.c
Outdated
(Int)TNAM_OBJ(flags2), 0L, | ||
"you can replace <flags2> via 'return <flags2>;'" ); | ||
} | ||
if ( flags1 == flags2 ) { |
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.
Why don't you do this check in the EqFlags
method?
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.
Because this is an internal API, where the caller is expected to already have checked the input. And when called via EQ / EqFuncs, the tnums are automatically verified, too.
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.
Yeah, I think I put the comment in a slightly confusing place, and of course did not specify what I really meant, sorry.
What I actually meant was:
Why is the if ( flags1 == flags2 )
check not in the EqFlags
method?
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.
Ahhh, sorry, I overlooked that line. Good question, I guess I forgot to move it, oops.
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.
No worries :). I think I should have specified this more.
295c12f
to
b5afac5
Compare
Move the check for identical filters into |
src/opers.c
Outdated
} | ||
# endif | ||
cache = AND_CACHE_FLAGS(flags2); |
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.
Your comment above, and code here, don't seem to agree -- you say you get the cache of the smaller, but you get the cache of the bigger (I don't mine which gets fixed, as I don't think it matters).
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.
Oops, indeed, will fix.
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.
Fixed
In particular, before calling functions like FuncHASH_FLAGS which also require flags as input.
b5afac5
to
891619a
Compare
No description provided.