Skip to content
This repository
Browse code

remove uneeded shared_ptr copy

  • Loading branch information...
commit 76e108ff9d49e96e6e622600669b2d5ee5c1c863 1 parent 93995d7
Dane Springmeyer authored March 13, 2012
3  src/text_placements/list.cpp
@@ -63,8 +63,7 @@ text_symbolizer_properties & text_placements_list::get(unsigned i)
63 63
 
64 64
 text_placement_info_ptr text_placements_list::get_placement_info(double scale_factor) const
65 65
 {
66  
-    return text_placement_info_ptr(
67  
-        boost::make_shared<text_placement_info_list>(this, scale_factor));
  66
+    return boost::make_shared<text_placement_info_list>(this, scale_factor);
68 67
 }
69 68
 
70 69
 text_placements_list::text_placements_list() : text_placements(), list_(0)
9  src/text_placements/simple.cpp
@@ -103,8 +103,7 @@ bool text_placement_info_simple::next_position_only()
103 103
 text_placement_info_ptr text_placements_simple::get_placement_info(
104 104
     double scale_factor) const
105 105
 {
106  
-    return text_placement_info_ptr(
107  
-        boost::make_shared<text_placement_info_simple>(this, scale_factor));
  106
+    return boost::make_shared<text_placement_info_simple>(this, scale_factor);
108 107
 }
109 108
 
110 109
 /** Position string: [POS][SIZE]
@@ -145,10 +144,12 @@ void text_placements_simple::set_positions(std::string positions)
145 144
                      (direction_name[push_back(phoenix::ref(direction_), _1)] % ',') >> *(',' >> qi::float_[push_back(phoenix::ref(text_sizes_), _1)]),
146 145
                      space
147 146
         );
148  
-    if (first != last) {
  147
+    if (first != last)
  148
+    {
149 149
         std::cerr << "WARNING: Could not parse text_placement_simple placement string ('" << positions << "').\n";
150 150
     }
151  
-    if (direction_.size() == 0) {
  151
+    if (direction_.size() == 0)
  152
+    {
152 153
         std::cerr << "WARNING: text_placements_simple with no valid placements! ('"<< positions<<"')\n";
153 154
     }
154 155
 }

0 notes on commit 76e108f

Please sign in to comment.
Something went wrong with that request. Please try again.