Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use arity hashCode instead of proc#hash in CallableSelector (#4494)
Using proc#hash as the cache key means that you're only guaranteed to get a cache hit if exactly the same proc is being passed. Using arity.hashCode instead should satisfy the original reason for hashing the proc (disambiguate signatures based on the arity of the proc) while preventing cache misses. Also note that this was causing a memory leak: executing the code that relies on this caching would create a new cache entry on every invocation, slowly growing the size of the cache.