Skip to content

Commit

Permalink
lipstick
Browse files Browse the repository at this point in the history
  • Loading branch information
v4hn committed Sep 6, 2021
1 parent ac22156 commit 476424d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/include/moveit/task_constructor/properties.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ class PropertyMap
/// allow initialization from given source for listed properties - always using the same name
void configureInitFrom(Property::SourceFlags source, const std::set<std::string>& properties = {});

/// set (and, if neccessary, declare) the value of a property
/// set (and, if necessary, declare) the value of a property
template <typename T>
void set(const std::string& name, const T& value) {
auto it = props_.find(name);
Expand Down
6 changes: 3 additions & 3 deletions core/src/properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class PropertyTypeRegistry
PropertySerializerBase::SerializeFunction serialize_;
PropertySerializerBase::DeserializeFunction deserialize_;
};
Entry dummy_;
const Entry dummy_;

// map from type_info to corresponding converter functions
using RegistryMap = std::map<std::type_index, Entry>;
Expand Down Expand Up @@ -193,7 +193,7 @@ Property& Property::configureInitFrom(SourceFlags source, const std::string& nam
Property& PropertyMap::declare(const std::string& name, const Property::type_info& type_info,
const std::string& description, const boost::any& default_value) {
auto it_inserted = props_.insert(std::make_pair(name, Property(type_info, description, default_value)));
// if name was already declared, the new declaration should match in type (except it was boost::any)
// if name was already declared, the new declaration should match in type (except if it was boost::any)
if (!it_inserted.second && it_inserted.first->second.type_info_ != typeid(boost::any) &&
type_info != it_inserted.first->second.type_info_)
throw Property::type_error(type_info.name(), it_inserted.first->second.type_info_.name());
Expand Down Expand Up @@ -269,7 +269,7 @@ const boost::any& PropertyMap::get(const std::string& name) const {
size_t PropertyMap::countDefined(const std::vector<std::string>& list) const {
size_t count = 0u;
for (const std::string& name : list) {
if (!get(name).empty())
if (!property(name).defined())
++count;
}
return count;
Expand Down

0 comments on commit 476424d

Please sign in to comment.