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

src/opers.c: tweak and cleanup code; add tests #2296

Merged
merged 11 commits into from
Mar 27, 2018

Conversation

fingolfin
Copy link
Member

No description provided.

@fingolfin fingolfin added topic: tests issues or PRs related to tests topic: kernel release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes labels Mar 25, 2018
@fingolfin fingolfin force-pushed the mh/opers-filters-flags branch from a84983e to 045c704 Compare March 25, 2018 12:42
@codecov
Copy link

codecov bot commented Mar 25, 2018

Codecov Report

Merging #2296 into master will increase coverage by 15.5%.
The diff coverage is 100%.

@@            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
Impacted Files Coverage Δ
lib/oper.g 81.26% <100%> (+7.68%) ⬆️
src/opers.c 92.02% <100%> (+16.31%) ⬆️
src/gapstate.h 71.42% <0%> (-28.58%) ⬇️
src/funcs.c 80.19% <0%> (-13.71%) ⬇️
lib/random.g 93.33% <0%> (-6.67%) ⬇️
src/objset.c 81.71% <0%> (-2.9%) ⬇️
src/gasman.h 90% <0%> (-1.67%) ⬇️
src/objscoll.c 66.12% <0%> (-1.28%) ⬇️
src/read.c 84.27% <0%> (-0.79%) ⬇️
lib/info.gi 60.5% <0%> (-0.52%) ⬇️
... and 360 more

@fingolfin fingolfin force-pushed the mh/opers-filters-flags branch from 045c704 to 295c12f Compare March 25, 2018 21:47
src/opers.c Outdated
(Int)TNAM_OBJ(flags2), 0L,
"you can replace <flags2> via 'return <flags2>;'" );
}
if ( flags1 == flags2 ) {
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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.

@fingolfin fingolfin force-pushed the mh/opers-filters-flags branch from 295c12f to b5afac5 Compare March 27, 2018 08:15
@fingolfin
Copy link
Member Author

Move the check for identical filters into EqFlags, and actually added a test for using = on equal but not identical filters (for identical filters, GAP has a hotpath that causes = to return immediately, so it is impossible to call EqFlags with identical arguments that way)

src/opers.c Outdated
}
# endif
cache = AND_CACHE_FLAGS(flags2);
Copy link
Contributor

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).

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops, indeed, will fix.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

@fingolfin fingolfin force-pushed the mh/opers-filters-flags branch from b5afac5 to 891619a Compare March 27, 2018 11:03
@fingolfin fingolfin merged commit 867bca4 into gap-system:master Mar 27, 2018
@fingolfin fingolfin deleted the mh/opers-filters-flags branch March 27, 2018 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes topic: kernel topic: tests issues or PRs related to tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants