]> git.sesse.net Git - stockfish/commitdiff
Use an array index instead of an iterator in root list
authorMarco Costalba <mcostalba@gmail.com>
Sat, 18 Jun 2011 06:43:25 +0000 (07:43 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 18 Jun 2011 07:03:59 +0000 (08:03 +0100)
It is not correct to use an iterator stick on a vector that
is sorted becuase iterator is invalidated in general case.

It happens to work by accident because iterators are implemented
as pointers and so they behave in the same (correct) way then
using array indices, but the latters are the correct thing to use.

Also better document the code.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>

No differences found