Issues

Select view

Select search mode

 
50 of 65

Sentinel keyword checks using = may cause unnecessary realization

Description

per

The expression (= ::expired v) in clojure.core.cache.wrapped/lookup-or-miss.

What happens is that = internally calls clojure.lang.Util/equiv (since LazyMap implements IPersistentCollection) and then, after some dispatching, equiv is called to check whether the contents of a lazy map equals to other object (implicitly other map). This is the desired behavior and lazy map realizes all values to make comparison possible.

Environment

None

Details

Assignee

Reporter

Approval

Vetted

Priority

Created March 3, 2023 at 5:37 PM
Updated March 3, 2023 at 7:02 PM

Activity

Show:

Flag notifications