It would be great if this could be fixed. It is overridden in Vector,
though:
override /*TraversableLike*/ def last: A = {
if (isEmpty) throw new UnsupportedOperationException("empty.last")
apply(length-1)
}
I don't know if there is a reason why this is not in `IndexedSeq` instead.
best, .h.h.
On 19/10/16 14:50, Wilson de Carvalho wrote:
> Hello,
>
> I hope this is the right list for this issue:
>
> I'd like to make an improvement in IndexedSeq derived traits. "last"
> operation performance is currently linear, since its implementation is
> inherited from TraversableLike, but it could be constant due to the
> nature of this type of collection. Since I'm a begginner here, I'd like
> to know if there is any reason why this was not implemented (besides it
> was forgotten).
>
> Regards.
>
> --
> You received this message because you are subscribed to the Google
> Groups "scala-sips" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to scala-sips+unsubscribe@googlegroups.com
> <mailto:scala-sips+unsub...@googlegroups.com>.
--
You received this message because you are subscribed to the Google Groups "scala-sips" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-sips+unsubscribe@googlegroups.com.