-
Notifications
You must be signed in to change notification settings - Fork 163
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
fixed an error in the default method for PositionNot #1672
Conversation
This seems to be breaking |
lib/kernel.g
Outdated
@@ -168,7 +168,7 @@ POSITION_NOT := function( arg ) | |||
return i; | |||
fi; | |||
od; | |||
return LENGTH(arg[1]) + 1; | |||
return arg[3] + 1; |
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.
This is not quite correct: Think about arg[3] being 0 (in fact, PositionNot(list,x)
is defined as PositionNot(list,x,0)
.
So instead of changing this line, you could insert this before line 166:
if arg[3]+1 > LENGTH(arg[1]) then
return arg[3] + 1;
fi;
Codecov Report
@@ Coverage Diff @@
## master #1672 +/- ##
==========================================
+ Coverage 64.42% 64.42% +<.01%
==========================================
Files 1002 1002
Lines 326709 326712 +3
Branches 13197 13218 +21
==========================================
+ Hits 210477 210486 +9
+ Misses 113363 113357 -6
Partials 2869 2869
|
(and PositionNonZero), in the case that the given 'from' value is larger than the length of the list
381f1c3
to
adeb73c
Compare
just fixed the fix, thanks for the hints |
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.
Code looks good now, let's wait for the test, though
fixed an error in the default method for PositionNot (and PositionNonZero),
in the case that the given 'from' value is larger than the length of the list