perglue.cpp - use static_cast instead of dynamic_cast if possible,

use switch instead of plenty of ifs,
export clone<DynamicPrintConfig> to Perl XS.
This commit is contained in:
bubnikv 2017-10-17 19:19:41 +02:00
parent 746afbd790
commit b9d57483d8
4 changed files with 150 additions and 166 deletions

View file

@ -38,7 +38,7 @@ Fill* Fill::new_from_type(const InfillPattern type)
Fill* Fill::new_from_type(const std::string &type)
{
static t_config_enum_values enum_keys_map = ConfigOptionEnum<InfillPattern>::get_enum_values();
const t_config_enum_values &enum_keys_map = ConfigOptionEnum<InfillPattern>::get_enum_values();
t_config_enum_values::const_iterator it = enum_keys_map.find(type);
return (it == enum_keys_map.end()) ? nullptr : new_from_type(InfillPattern(it->second));
}