Re: Quick way to initialize array with all zeros




"Andrew Thompson" <andrewthommo@xxxxxxxxx> wrote in message
news:1175362082.877883.68360@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Apr 1, 4:05 am, "George Cherry" <
..
Why did you fill the int array with 1's in the for loop test
and 0's in the Arrays.fill test?

"Because I'm evil".

LOL, sometimes I crack me up. ;-)

Why not? I was (ever so slightly) worried that
the JIT compiler would notice the inefficiency of
doing something that had already been done, and
ignore the second call.

Oh. (Are JIT compilers that smart?)

(muses) maybe I should
have put all 'random' values..

Or--at least--initialize a different array in
each test.

George


.