From 87852933851674cacbc8b2295d046831db27ab81 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Sun, 25 May 2025 12:38:39 +0200 Subject: Cleanup --- web/adapter.cpp | 38 -------------------------------------- 1 file changed, 38 deletions(-) (limited to 'web/adapter.cpp') diff --git a/web/adapter.cpp b/web/adapter.cpp index c3134e9..71a34ab 100644 --- a/web/adapter.cpp +++ b/web/adapter.cpp @@ -114,8 +114,6 @@ int poll_status(void *arg) return callFunctionInt(*(int *)arg); } -#if 1 - nissy::solver::solve_result solve(std::string name, nissy::cube cube, nissy::nissflag nissflag, unsigned minmoves, unsigned maxmoves, unsigned maxsols, unsigned optimal, unsigned threads, @@ -137,35 +135,6 @@ nissy::solver::solve_result solve(std::string name, maxmoves, maxsols, optimal, threads, NULL, &poll_status_id); } -#else - -std::string solve(std::string name, - nissy::cube cube, nissy::nissflag nissflag, unsigned minmoves, - unsigned maxmoves, unsigned maxsols, unsigned optimal, unsigned threads, - int poll_status_id) -{ - // Here we use a dirty trick to make this function always return the - // same kind of JavaScript object. If we did not do this, the returned - // object would be a Promise on the first run of the solver for each - // session (because when loading the table some async JS code is - // called), and a regular object otherwise. - // TODO figure out if there is a better way to do this. - fake_async(); - - if (!solver_valid(name)) - return ""; -/* - return nissy::solver::solve_result - {.err = nissy::error::INVALID_SOLVER}; -*/ - - return loaded_solvers.at(name).solve(cube, nissflag, minmoves, - maxmoves, maxsols, optimal, threads, NULL, &poll_status_id) - .solutions[0]; -} - -#endif - EMSCRIPTEN_BINDINGS(Nissy) { emscripten::class_("NissFlag") @@ -208,13 +177,6 @@ EMSCRIPTEN_BINDINGS(Nissy) .function("toString", &nissy::cube::to_string) ; -/* - emscripten::register_vector("StringVector"); - emscripten::value_array("SolveResult") - .element(&nissy::solver::solve_result::err) - .element(&nissy::solver::solve_result::solutions) - ; -*/ emscripten::class_("SolveResult") .property("err", &nissy::solver::solve_result::err) .property("solutions", &nissy::solver::solve_result::solutions) -- cgit v1.3