Skip to content

Commit

Permalink
Bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
mooskagh committed Jan 18, 2025
1 parent 4bff1fc commit a8e2f4a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/neural/memcache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,11 @@ std::optional<EvalResult> MemCache::GetCachedEvaluation(
result.d = lock->d;
result.q = lock->q;
result.m = lock->m;
std::copy(lock->p.get(), lock->p.get() + pos.legal_moves.size(),
result.p.begin());
if (lock->p) {
result.p.reserve(pos.legal_moves.size());
std::copy(lock->p.get(), lock->p.get() + pos.legal_moves.size(),
std::back_inserter(result.p));
}
return result;
}

Expand Down

0 comments on commit a8e2f4a

Please sign in to comment.