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

Dead code #13

Closed
dkempe opened this issue Mar 14, 2016 · 2 comments
Closed

Dead code #13

dkempe opened this issue Mar 14, 2016 · 2 comments

Comments

@dkempe
Copy link
Contributor

dkempe commented Mar 14, 2016

In common/math.rkt there are multiple instances of dead code that, were it live, would be unsafe.

In both vector-ormap and vector-andmap, the final case of the case-lambda clause (for cases with more than two input vectors) is never called. If they were, the vector reference would be referencing exactly outside of the bounds of the vector. Specifically, (vector-ref xs n) where (= n (vector-length xs)) is called thrice for each definition.

@stamourv
Copy link
Contributor

I don't see the exact access you're referring to, but the ones on lines 174 and 176 (and their equivalents in vector-ormap) definitely look suspicious. Line 169 (mutatis mutandis) also looks odd. Why iterate to 2, instead of over all of vs.

If that code is indeed dead, would you be interested in submitting a pull request to get rid of it? A PR fixing it and adding tests for the currently-broken behavior works too. :)

@bennn
Copy link
Contributor

bennn commented Aug 21, 2018

6ca968b

@bennn bennn closed this as completed Aug 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants