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
Ciao Seba,
The
*LinkedOpenHashMap*classes have methods such asfirst$TYPE,last$TYPE,removeFirst$TYPE,removeLast$TYPEwhich return a primitive. Would it please be possible to have the same methods also for theListtypes (and possibly others), to avoid boxing/unboxing ?My use case is removing a random element from an
$TYPEArrayListby overwriting it with the last element of the list, as inlist.set(randomIndex, list.removeLast()), and I would like to useremoveLast$TYPE()at the end (I understand that I could uselist.remove$TYPE(list.size() - 1), but I assumeremoveLast()wouldn't incur in the cost of range-checking, maybe?)Thanks,
Matteo