Skip to content
Discussion options

You must be logged in to vote

Good catch, that e parameter isn't doing anything. equalityCheck already closes over value, so passing it down the recursion is redundant. It looks like a leftover from an earlier version rather than a deliberate optimization.

It doesn't break anything, and the cost is basically one extra argument per call, so you won't notice it in practice. It's still dead code though, so it could just be:

let rec contains xs1 =
match xs1 with
| [] -> false
| h1 :: t1 -> equalityCheck h1 || contains t1

contains source

Probably worth opening a small PR for it, cleanups like this usually get accepted pretty quickly.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by davidgrenier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants