Skip to content

Commit 4e15d8a

Browse files
committed
clean up return after exception
1 parent 51d28e0 commit 4e15d8a

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

include/ruckig/calculator_cloud.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,8 @@ class WaypointsCalculator {
178178
Result continue_calculation(const InputParameter<DOFs, CustomVector>&, Trajectory<DOFs, CustomVector>&, double, bool&) {
179179
if constexpr (throw_error) {
180180
throw RuckigError("continue calculation not available in Ruckig Community Version.");
181-
} else {
182-
return Result::Error;
183181
}
182+
return Result::Error;
184183
}
185184
};
186185

include/ruckig/calculator_target.hpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -311,16 +311,14 @@ class TargetCalculator {
311311
if (has_zero_limits) {
312312
if constexpr (throw_error) {
313313
throw RuckigError("zero limits conflict in step 1, dof: " + std::to_string(dof) + " input: " + inp.to_string());
314-
} else {
315-
return Result::ErrorZeroLimits;
316314
}
315+
return Result::ErrorZeroLimits;
317316

318317
} else {
319318
if constexpr (throw_error) {
320319
throw RuckigError("error in step 1, dof: " + std::to_string(dof) + " input: " + inp.to_string());
321-
} else {
322-
return Result::ErrorExecutionTimeCalculation;
323320
}
321+
return Result::ErrorExecutionTimeCalculation;
324322
}
325323
}
326324

@@ -350,16 +348,14 @@ class TargetCalculator {
350348
if (has_zero_limits) {
351349
if constexpr (throw_error) {
352350
throw RuckigError("zero limits conflict with other degrees of freedom in time synchronization " + std::to_string(traj.duration));
353-
} else {
354-
return Result::ErrorZeroLimits;
355351
}
352+
return Result::ErrorZeroLimits;
356353

357354
} else {
358355
if constexpr (throw_error) {
359356
throw RuckigError("error in time synchronization: " + std::to_string(traj.duration));
360-
} else {
361-
return Result::ErrorSynchronizationCalculation;
362357
}
358+
return Result::ErrorSynchronizationCalculation;
363359
}
364360
}
365361

@@ -515,9 +511,8 @@ class TargetCalculator {
515511
if (!found_time_synchronization) {
516512
if constexpr (throw_error) {
517513
throw RuckigError("error in step 2 in dof: " + std::to_string(dof) + " for t sync: " + std::to_string(traj.duration) + " input: " + inp.to_string());
518-
} else {
519-
return Result::ErrorSynchronizationCalculation;
520514
}
515+
return Result::ErrorSynchronizationCalculation;
521516
}
522517
// std::cout << dof << " profile step2: " << p.to_string() << std::endl;
523518
}

0 commit comments

Comments
 (0)