These two statements are equivalent:
a > size - 1
a >= size
They always return the same result.
Type: Posts; User: Cornix
These two statements are equivalent:
a > size - 1
a >= size
They always return the same result.
The second implementation looks horrible. I know nobody that would write something like that.
The first implementation looks fine though. Although I would probably prefer:
if(indexNumber < 0 ||...