I'm surprised there isn't a `IntRange.size` … Am I...
# stdlib
c
I'm surprised there isn't a
IntRange.size
… Am I missing something?
h
size
is often an
Int
, like
Collection.size
, and you can create
IntRanges
with a bigger size:
(-1).rangeTo(Int.MAX_VALUE)
👀 1
h
As
IntRange
is
Iterable
, you could use
Iterable.count()
… but that is not very efficient/performant and returns an only an
Int
as well…