File tree Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -326,10 +326,14 @@ struct StateManager
326
326
* pruning. Note, that the weighting factor was initially applied when computing `h` of a state for adding
327
327
* it to the priority queue. */
328
328
const auto min_path_cost = [&]() {
329
- if constexpr (use_weighted_search)
330
- return is_admissible<Heurisitc> ? state.g () + h / weighting_factor () : state.g ();
331
- else
332
- return is_admissible<Heurisitc> ? state.g () + h : state.g ();
329
+ if constexpr (is_admissible<Heurisitc>) {
330
+ if constexpr (use_weighted_search)
331
+ return state.g () + h / weighting_factor ();
332
+ else
333
+ return state.g () + h;
334
+ } else {
335
+ return state.g ();
336
+ }
333
337
}();
334
338
if (min_path_cost >= least_path_cost) [[unlikely]] {
335
339
inc_pruned_by_cost ();
@@ -417,10 +421,14 @@ struct StateManager
417
421
* factor before pruning. Note, that the weighting factor was initially applied when computing `h`
418
422
* of a state for adding it to the priority queue. */
419
423
const auto min_path_cost = [&]() {
420
- if constexpr (use_weighted_search)
421
- return is_admissible<Heurisitc> ? state.g () + h / weighting_factor () : state.g ();
422
- else
423
- return is_admissible<Heurisitc> ? state.g () + h : state.g ();
424
+ if constexpr (is_admissible<Heurisitc>) {
425
+ if constexpr (use_weighted_search)
426
+ return state.g () + h / weighting_factor ();
427
+ else
428
+ return state.g () + h;
429
+ } else {
430
+ return state.g ();
431
+ }
424
432
}();
425
433
if (min_path_cost >= least_path_cost) [[unlikely]] {
426
434
inc_pruned_by_cost ();
You can’t perform that action at this time.
0 commit comments