Rename *last to *end

It is a more correct name because it points past the
last move of the list.

No functional change.
This commit is contained in:
Marco Costalba
2012-09-09 10:17:31 +02:00
parent 6e840f8033
commit 834bd9edd7
3 changed files with 60 additions and 60 deletions

View File

@@ -431,16 +431,16 @@ MoveStack* generate<EVASIONS>(const Position& pos, MoveStack* mlist) {
template<>
MoveStack* generate<LEGAL>(const Position& pos, MoveStack* mlist) {
MoveStack *last, *cur = mlist;
MoveStack *end, *cur = mlist;
Bitboard pinned = pos.pinned_pieces();
last = pos.in_check() ? generate<EVASIONS>(pos, mlist)
: generate<NON_EVASIONS>(pos, mlist);
while (cur != last)
end = pos.in_check() ? generate<EVASIONS>(pos, mlist)
: generate<NON_EVASIONS>(pos, mlist);
while (cur != end)
if (!pos.pl_move_is_legal(cur->move, pinned))
cur->move = (--last)->move;
cur->move = (--end)->move;
else
cur++;
return last;
return end;
}