ropes icon indicating copy to clipboard operation
ropes copied to clipboard

hasheq throws Exception for empty rope

Open phronmophobic opened this issue 9 months ago • 0 comments

hasheq seems to work for ropes with non empty ropes, but throws for empty ropes.

A short repro:

> (contains? #{(ropes/rope [])} :whatever)
Execution error (NullPointerException) at ropes.core.Rope/hasheq (core.clj:28).
Cannot invoke "java.lang.Iterable.iterator()" because "xs" is null

I also noticed that the hash value isn't cached which may be helpful. Maybe something like https://github.com/thi-ng/geom/blob/a40a7f57b28220a82f500742712309d665811329/src/thi/ng/geom/matrix.cljc#L74

phronmophobic avatar Apr 07 '25 23:04 phronmophobic