Skip to content

Commit

Permalink
scoresのサイズをmovesと一致させる
Browse files Browse the repository at this point in the history
  • Loading branch information
TadaoYamaoka committed Apr 29, 2021
1 parent f9c6061 commit 0c29d06
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,10 @@ namespace parser {
auto last = line.find_first_of(" ", 4);
if (last == std::string::npos)
last = line.size();
scores.resize(moves.size());
try {
scores[moves.size() - 1] = std::stoi(line.substr(4, last - 4));
}
catch (std::invalid_argument&) {}
comments.resize(moves.size());
comments[moves.size() - 1] = line.substr(4);
}
else {
Expand Down Expand Up @@ -183,6 +181,7 @@ namespace parser {
moves.push_back(move.value());
states->push_back(StateInfo());
pos.doMove(move, states->back());
scores.resize(moves.size());
// Comment
comments.resize(moves.size());
if (line.substr(7, 2) == ",\'") {
Expand Down

0 comments on commit 0c29d06

Please sign in to comment.