Skip to content

Commit e79b867

Browse files
committed
this was actually cleaner
1 parent 6215c4b commit e79b867

File tree

1 file changed

+2
-5
lines changed
  • src/viam/examples/modules/complex/summation

1 file changed

+2
-5
lines changed

src/viam/examples/modules/complex/summation/impl.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,8 @@ bool find_subtract(ResourceConfig cfg) {
1717
if (subtract == cfg.attributes().end()) {
1818
return false;
1919
}
20-
const bool* const subtract_bool = subtract->second.get<bool>();
21-
if (!subtract_bool) {
22-
return false;
23-
}
24-
return *subtract_bool;
20+
21+
return subtract->second.is_a<bool>() && subtract->second.get_unchecked<bool>();
2522
}
2623

2724
void MySummation::reconfigure(const Dependencies& deps, const ResourceConfig& cfg) {

0 commit comments

Comments
 (0)