@@ -62,10 +62,7 @@ struct chessy::Index
inline int getColumn (void) const { return index & 0x7; }
inline int getRow (void) const { return (index >> 3) & 0x7; }
- inline std::string getName(void) const
- {
- return { char('a' + getColumn()), char(getRow() + '1') };
- }
+ std::string getName(void) const;
};
@@ -405,6 +405,8 @@ void chessy::generateAllMoves(const ChessGame& cg, std::vector<Move>& moves)
template<Side side>
void chessy::orderMoves(const ChessGame& cg, std::vector<Move>& moves)
{
+ if (moves.empty())
+ return;
auto a = moves.begin();
auto b = moves.end() - 1;
Bitboard enemies = cg.getBoard().get<otherSide(side)>();