LazySeq should utilize cached hash from its underlying seq.

Description

Even if underlying seq contains a cached hash, LazySeq computes it every time.

Approach: If seq produced by LazySeq implementing IHashEq, use it to calculate the hasheq().
Patch: clj-1373.diff

Environment

1.6.0 master SNAPSHOT

Activity

Show:
Jozef Wagner
March 9, 2014, 3:20 PM

Added patch which checks if underlying seq implements IHashEq and if yes, uses that hash instead of recomputing.

Alex Miller
May 4, 2015, 3:34 PM

In this patch, can you update the else case (the original code) to use s rather than this, so seq() is not re-called?

Jozef Wagner
May 4, 2015, 6:30 PM

Added patch

that reuses s for else case.

Alex Miller
June 23, 2015, 8:15 PM

The -2 patch doesn't compile so I guess that was a bad suggestion.

Assignee

Unassigned

Reporter

Jozef Wagner

Approval

Triaged

Patch

Code

Priority

Minor
Configure