mediocregopher / seq

A go library providing clojure-like immutable data-structures and functional ways to interact with them

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Need to add i to hased bytes?

raviqqe opened this issue · comments

This line to hash []byte is not using i. Is it OK?
https://github.com/mediocregopher/seq/blob/master/hashset.go#L65

Or, is it should be like the below?

	case []byte:
		return hash(crc32.ChecksumIEEE(vt), i)

I'll be honest, it's been a long long time since I've looked at this code, and I don't quite remember what that i was even for >_< But my comment on the Hash method indicates that i is a best-effort thing, so it doesn't need to be taken into account, it just should be if possible. Were you encountering problems because of this? Your change looks like it would be fine, if you want to submit another PR.

My code using your library works pretty well. I just wonder why the code doesn't use i and guessed it's a bug. I don't wanna touch the current code because I don't understand what it does exactly. :)
You can just close this issue if you don't care about it.

Ok, well if you see any problems that might be a result of this definitely reopen this issue and we can figure it out. Thanks!