From ad1e483787cbc3aeb62c9afb9e31520df5a4b559 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Tue, 15 Apr 2025 09:30:23 +0200 Subject: Simplified count_moves() in cpp api --- cpp/nissy.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'cpp/nissy.cpp') diff --git a/cpp/nissy.cpp b/cpp/nissy.cpp index 6e1b700..b3bf6c4 100644 --- a/cpp/nissy.cpp +++ b/cpp/nissy.cpp @@ -221,13 +221,10 @@ namespace nissy { solver::solver(const std::string& str) : name{str} {} - std::variant - count_moves(const std::string& moves) + error count_moves(const std::string& moves) { auto err = nissy_countmoves(moves.c_str()); - if (err < 0) - return error{err}; - return (unsigned)err; + return error{err}; } void set_logger(const std::function& log) -- cgit v1.3