find-if does not stop searching when item found
220.127.116.11 ("FIND/POSITION bounds checking on lists") introduced a regression: find-if now iterates through the entire list. Example:
* (find-if #'evenp '(1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 :foo))
debugger invoked on a SIMPLE-TYPE-ERROR in thread #<THREAD
Argument X is not a INTEGER: :FOO
Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
restarts (invokable by number or by possibly-
0: [ABORT] Exit debugger, returning to top level.
Since 2 is even, the test function should never be run on :foo.
A fix and test case are attached. Someone will probably want to adjust the test case name.
I changed two tests from 18.104.22.168/bug 452008. If find or position locates the element before it realizes that :end is past the end of the list, I see no problem just returning that element: failing to check the bounds doesn't lead to an incorrect result.