]> git.sesse.net Git - stockfish/commit
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)
commit8173d92dd2b339e02dcf0ae6de9954ef33e3e0a1
tree8d913236d8c179a143c44615ad1d079939584a94
parent808a4fe817f79f472c92e7b9fb914a8be73ff1be
Use an array index instead of an iterator in root list

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>
src/search.cpp