eclipse-collections icon indicating copy to clipboard operation
eclipse-collections copied to clipboard

primitive and generic map interface methods that return views should always return lazy iterables

Open victornoel opened this issue 3 years ago • 0 comments

I noticed while browsing primitive map interfaces that, for example, the keysView() will return a lazy iterable, but the keyValueView() won't. Also in generic MapIterable interface, keyView(), keyValueView() and valuesView() will return RichIterable but will always have it implemented with LazyIterable. Also the javadoc says it should return a lazy iterable.

I would propose to unify all of this by:

  • always returning lazy iterables in all situations
  • add valuesView() also to primitive maps (simply delegating to asLazy())

I think it would nicely improve the dev experience of eclipse-collections users :)

victornoel avatar Apr 02 '22 17:04 victornoel