Open
Description
Ciao Seba,
The *LinkedOpenHashMap*
classes have methods such as first$TYPE
, last$TYPE
, removeFirst$TYPE
, removeLast$TYPE
which return a primitive. Would it please be possible to have the same methods also for the List
types (and possibly others), to avoid boxing/unboxing ?
My use case is removing a random element from an $TYPEArrayList
by overwriting it with the last element of the list, as in list.set(randomIndex, list.removeLast())
, and I would like to use removeLast$TYPE()
at the end (I understand that I could use list.remove$TYPE(list.size() - 1)
, but I assume removeLast()
wouldn't incur in the cost of range-checking, maybe?)
Thanks,
Matteo
Metadata
Metadata
Assignees
Labels
No labels