sq 自增由 i=i+1 改为 ++i

This commit is contained in:
Calcitem 2020-12-13 22:00:29 +08:00
parent d8270658b0
commit 0663f3e9e9
2 changed files with 3 additions and 3 deletions

View File

@ -1153,7 +1153,7 @@ int Position::get_mobility_diff(bool includeFobidden)
int diff = 0;
int n = 0;
for (Square i = SQ_BEGIN; i < SQ_END; i = static_cast<Square>(i + 1)) {
for (Square i = SQ_BEGIN; i < SQ_END; ++i) {
n = surrounded_empty_squares_count(i, includeFobidden);
if (board[i] & B_STONE) {
@ -1488,7 +1488,7 @@ int Position::add_mills(Square s)
bool Position::is_all_in_mills(Color c)
{
for (Square i = SQ_BEGIN; i < SQ_END; i = static_cast<Square>(i + 1)) {
for (Square i = SQ_BEGIN; i < SQ_END; ++i) {
if (board[i] & ((uint8_t)make_piece(c))) {
if (!in_how_many_mills(i, NOBODY)) {
return false;

View File

@ -294,7 +294,7 @@ enum : int
DEPTH_OFFSET = DEPTH_NONE
};
enum Square : int32_t
enum Square : int
{
SQ_0 = 0, SQ_1 = 1, SQ_2 = 2, SQ_3 = 3, SQ_4 = 4, SQ_5 = 5, SQ_6 = 6, SQ_7 = 7,
SQ_8 = 8, SQ_9 = 9, SQ_10 = 10, SQ_11 = 11, SQ_12 = 12, SQ_13 = 13, SQ_14 = 14, SQ_15 = 15,