Triviality in struct PieceLetters

And little touches in search() too.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2010-12-24 15:25:11 +01:00
parent d55a5a4d81
commit f97c5b6909
2 changed files with 21 additions and 17 deletions
+11 -8
View File
@@ -101,20 +101,23 @@ namespace {
operator[]('B') = WB; operator[]('b') = BB;
operator[]('N') = WN; operator[]('n') = BN;
operator[]('P') = WP; operator[]('p') = BP;
operator[](' ') = PIECE_NONE; operator[]('.') = PIECE_NONE_DARK_SQ;
operator[](' ') = PIECE_NONE;
operator[]('.') = PIECE_NONE_DARK_SQ;
}
char from_piece(Piece p) const {
std::map<char, Piece>::const_iterator it;
for (it = begin(); it != end(); ++it)
if (it->second == p)
return it->first;
std::map<char, Piece>::const_iterator it;
for (it = begin(); it != end(); ++it)
if (it->second == p)
return it->first;
assert(false);
return 0;
assert(false);
return 0;
}
} pieceLetters;
};
PieceLetters pieceLetters;
}