Permalink
Browse files

avoid constructing extra temp object

  • Loading branch information...
Dane Springmeyer
Dane Springmeyer committed Mar 12, 2012
1 parent 42f9fe0 commit fb6bf401e9066d15342e189a7a23d05e373093a8
Showing with 5 additions and 6 deletions.
  1. +2 −2 src/load_map.cpp
  2. +1 −2 src/text_placements/dummy.cpp
  3. +2 −2 src/text_placements/simple.cpp
View
@@ -1336,7 +1336,7 @@ void map_parser::parse_text_symbolizer( rule & rule, ptree const & sym )
if (placement_type) {
placement_finder = placements::registry::instance()->from_xml(*placement_type, sym, fontsets_);
} else {
- placement_finder = text_placements_ptr(boost::make_shared<text_placements_dummy>());
+ placement_finder = boost::make_shared<text_placements_dummy>();
placement_finder->defaults.from_xml(sym, fontsets_);
}
if (strict_ &&
@@ -1379,7 +1379,7 @@ void map_parser::parse_shield_symbolizer( rule & rule, ptree const & sym )
if (placement_type) {
placement_finder = placements::registry::instance()->from_xml(*placement_type, sym, fontsets_);
} else {
- placement_finder = text_placements_ptr(boost::make_shared<text_placements_dummy>());
+ placement_finder = boost::make_shared<text_placements_dummy>();
}
placement_finder->defaults.from_xml(sym, fontsets_);
if (strict_ &&
@@ -35,8 +35,7 @@ bool text_placement_info_dummy::next()
text_placement_info_ptr text_placements_dummy::get_placement_info(
double scale_factor) const
{
- return text_placement_info_ptr(boost::make_shared<text_placement_info_dummy>(
- this, scale_factor));
+ return boost::make_shared<text_placement_info_dummy>(this, scale_factor);
}
} //ns mapnik
@@ -169,8 +169,8 @@ std::string text_placements_simple::get_positions()
text_placements_ptr text_placements_simple::from_xml(boost::property_tree::ptree const &xml, fontset_map const & fontsets)
{
- text_placements_ptr ptr = text_placements_ptr(boost::make_shared<text_placements_simple>(
- get_attr<std::string>(xml, "placements", "X")));
+ text_placements_ptr ptr = boost::make_shared<text_placements_simple>(
+ get_attr<std::string>(xml, "placements", "X"));
ptr->defaults.from_xml(xml, fontsets);
return ptr;
}

0 comments on commit fb6bf40

Please sign in to comment.