← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/bug-986611-cppcheck_performance-editor into lp:widelands

 

GunChleoc has proposed merging lp:~widelands-dev/widelands/bug-986611-cppcheck_performance-editor into lp:widelands.

Commit message:
Fixed performance issues in the editor that were flagged up by cppcheck: Passing parameters per reference in editor tools and in map generator.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #986611 in widelands: "Issues reported by cppcheck"
  https://bugs.launchpad.net/widelands/+bug/986611

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-986611-cppcheck_performance-editor/+merge/300997

Fixed performance issues in the editor that were flagged up by cppcheck: Passing parameters per reference in tools, and in map generator.

-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-986611-cppcheck_performance-editor into lp:widelands.
=== modified file 'src/editor/map_generator.cc'
--- src/editor/map_generator.cc	2016-05-12 13:50:40 +0000
+++ src/editor/map_generator.cc	2016-07-24 14:17:53 +0000
@@ -119,7 +119,7 @@
                                       uint32_t const* const random2,
                                       uint32_t const* const random3,
                                       uint32_t const* const random4,
-                                      FCoords const fc) {
+                                      const FCoords& fc) {
 	// We'll take the "D" terrain at first...
 	// TODO(unknown): Check how the editor handles this...
 
@@ -438,7 +438,7 @@
 	(uint32_t                  * const random2,
 	 uint32_t                  * const random3,
 	 uint32_t                  * const random4,
-	 Coords const c0, Coords const c1, Coords const c2,
+	 const Coords& c0, const Coords& c1, const Coords& c2,
 	 uint32_t const h1, uint32_t const h2, uint32_t const h3,
 	 RNG                       &       rng,
 	 MapGenAreaInfo::MapGenTerrainType & terrType)

=== modified file 'src/editor/map_generator.h'
--- src/editor/map_generator.h	2016-05-12 12:49:17 +0000
+++ src/editor/map_generator.h	2016-07-24 14:17:53 +0000
@@ -97,7 +97,7 @@
 		 uint32_t            const * const random2,
 		 uint32_t            const * const random3,
 		 uint32_t            const * const random4,
-		 FCoords                     const fc);
+		 const FCoords& fc);
 
 	uint8_t make_node_elevation
 		(double elevation, Coords);
@@ -109,7 +109,7 @@
 		(uint32_t                  * const random2,
 		 uint32_t                  * const random3,
 		 uint32_t                  * const random4,
-		 Coords const c0, Coords const c1, Coords const c2,
+		 const Coords& c0, const Coords& c1, const Coords& c2,
 		 uint32_t const h1, uint32_t const h2, uint32_t const h3,
 		 RNG                       &       rng,
 		 MapGenAreaInfo::MapGenTerrainType & terrType);

=== modified file 'src/editor/tools/decrease_height_tool.cc'
--- src/editor/tools/decrease_height_tool.cc	2016-04-06 09:23:04 +0000
+++ src/editor/tools/decrease_height_tool.cc	2016-07-24 14:17:53 +0000
@@ -28,7 +28,7 @@
 
 /// Decreases the heights by a value. Chages surrounding nodes if necessary.
 int32_t EditorDecreaseHeightTool::handle_click_impl(const Widelands::World& world,
-													Widelands::NodeAndTriangle<> center,
+													const Widelands::NodeAndTriangle<>& center,
                                                     EditorInteractive& /* parent */,
                                                     EditorActionArgs* args,
 													Widelands::Map* map) {
@@ -49,7 +49,7 @@
 
 int32_t EditorDecreaseHeightTool::handle_undo_impl
 	(const Widelands::World& world,
-	Widelands::NodeAndTriangle<> center,
+	const Widelands::NodeAndTriangle<>& center,
 	EditorInteractive & /* parent */,
 	EditorActionArgs* args,
 	Widelands::Map* map)

=== modified file 'src/editor/tools/decrease_height_tool.h'
--- src/editor/tools/decrease_height_tool.h	2016-04-06 09:23:04 +0000
+++ src/editor/tools/decrease_height_tool.h	2016-07-24 14:17:53 +0000
@@ -28,14 +28,14 @@
 
 	int32_t handle_click_impl
 		(const Widelands::World& world,
-		 Widelands::NodeAndTriangle<> center,
+		 const Widelands::NodeAndTriangle<>& center,
 		 EditorInteractive & parent,
 		 EditorActionArgs* args,
 		 Widelands::Map* map) override;
 
 	int32_t handle_undo_impl
 		(const Widelands::World& world,
-		 Widelands::NodeAndTriangle<> center,
+		 const Widelands::NodeAndTriangle<>& center,
 		 EditorInteractive& parent,
 		 EditorActionArgs* args,
 		 Widelands::Map* map) override;

=== modified file 'src/editor/tools/decrease_resources_tool.cc'
--- src/editor/tools/decrease_resources_tool.cc	2016-04-14 16:03:22 +0000
+++ src/editor/tools/decrease_resources_tool.cc	2016-07-24 14:17:53 +0000
@@ -35,7 +35,7 @@
  * there is not already another resource there.
 */
 int32_t EditorDecreaseResourcesTool::handle_click_impl(const Widelands::World& world,
-                                                       Widelands::NodeAndTriangle<> const center,
+                                                       const Widelands::NodeAndTriangle<>& center,
                                                        EditorInteractive& /* parent */,
                                                        EditorActionArgs* args,
                                                        Widelands::Map* map) {
@@ -66,7 +66,7 @@
 }
 
 int32_t EditorDecreaseResourcesTool::handle_undo_impl(const Widelands::World& world,
-													  Widelands::NodeAndTriangle<> center,
+													  const Widelands::NodeAndTriangle<>& center,
 													  EditorInteractive& parent,
 													  EditorActionArgs* args,
 													  Widelands::Map* map) {

=== modified file 'src/editor/tools/decrease_resources_tool.h'
--- src/editor/tools/decrease_resources_tool.h	2016-04-06 09:23:04 +0000
+++ src/editor/tools/decrease_resources_tool.h	2016-07-24 14:17:53 +0000
@@ -29,13 +29,13 @@
 	{}
 
 	int32_t handle_click_impl(const Widelands::World& world,
-	                          Widelands::NodeAndTriangle<> center,
+	                          const Widelands::NodeAndTriangle<>& center,
 	                          EditorInteractive& parent,
 	                          EditorActionArgs* args,
 							  Widelands::Map* map) override;
 
 	int32_t handle_undo_impl(const Widelands::World& world,
-	                         Widelands::NodeAndTriangle<> center,
+	                         const Widelands::NodeAndTriangle<>& center,
 	                         EditorInteractive& parent,
 	                         EditorActionArgs* args,
 							 Widelands::Map* map) override;

=== modified file 'src/editor/tools/delete_bob_tool.cc'
--- src/editor/tools/delete_bob_tool.cc	2016-04-06 09:23:04 +0000
+++ src/editor/tools/delete_bob_tool.cc	2016-07-24 14:17:53 +0000
@@ -29,7 +29,7 @@
 */
 int32_t
 EditorDeleteBobTool::handle_click_impl(const Widelands::World&,
-                                       Widelands::NodeAndTriangle<Widelands::Coords> center,
+                                       const Widelands::NodeAndTriangle<Widelands::Coords>& center,
                                        EditorInteractive& parent,
                                        EditorActionArgs* args,
 									   Widelands::Map* map) {
@@ -52,7 +52,7 @@
 
 int32_t
 EditorDeleteBobTool::handle_undo_impl(const Widelands::World& world,
-                                      Widelands::NodeAndTriangle<Widelands::Coords> center,
+                                      const Widelands::NodeAndTriangle<Widelands::Coords>& center,
                                       EditorInteractive& parent,
                                       EditorActionArgs* args,
 									  Widelands::Map* map) {

=== modified file 'src/editor/tools/delete_bob_tool.h'
--- src/editor/tools/delete_bob_tool.h	2016-04-06 09:23:04 +0000
+++ src/editor/tools/delete_bob_tool.h	2016-07-24 14:17:53 +0000
@@ -27,13 +27,13 @@
 	EditorDeleteBobTool() : EditorTool(*this, *this) {}
 
 	int32_t handle_click_impl(const Widelands::World& world,
-	                          Widelands::NodeAndTriangle<> center,
+	                          const Widelands::NodeAndTriangle<>& center,
 	                          EditorInteractive& parent,
 	                          EditorActionArgs* args,
 							  Widelands::Map* map) override;
 
 	int32_t handle_undo_impl(const Widelands::World& world,
-	                         Widelands::NodeAndTriangle<> center,
+	                         const Widelands::NodeAndTriangle<>& center,
 	                         EditorInteractive& parent,
 	                         EditorActionArgs* args,
 							 Widelands::Map* map) override;

=== modified file 'src/editor/tools/delete_immovable_tool.cc'
--- src/editor/tools/delete_immovable_tool.cc	2016-04-06 09:23:04 +0000
+++ src/editor/tools/delete_immovable_tool.cc	2016-07-24 14:17:53 +0000
@@ -29,7 +29,7 @@
  * Deletes the immovable at the given location
 */
 int32_t EditorDeleteImmovableTool::handle_click_impl(const Widelands::World&,
-                                                     Widelands::NodeAndTriangle<> const center,
+                                                     const Widelands::NodeAndTriangle<>& center,
                                                      EditorInteractive& parent,
                                                      EditorActionArgs* args,
 													 Widelands::Map* map) {
@@ -54,7 +54,7 @@
 }
 
 int32_t EditorDeleteImmovableTool::handle_undo_impl(const Widelands::World& world,
-													Widelands::NodeAndTriangle<Widelands::Coords> center,
+													const Widelands::NodeAndTriangle<Widelands::Coords>& center,
 													EditorInteractive& parent,
 													EditorActionArgs* args,
 													Widelands::Map* map) {

=== modified file 'src/editor/tools/delete_immovable_tool.h'
--- src/editor/tools/delete_immovable_tool.h	2016-04-06 09:23:04 +0000
+++ src/editor/tools/delete_immovable_tool.h	2016-07-24 14:17:53 +0000
@@ -27,13 +27,13 @@
 	EditorDeleteImmovableTool() : EditorTool(*this, *this) {}
 
 	int32_t handle_click_impl(const Widelands::World& world,
-	                          Widelands::NodeAndTriangle<> center,
+	                          const Widelands::NodeAndTriangle<>& center,
 	                          EditorInteractive& parent,
 	                          EditorActionArgs* args,
 							  Widelands::Map* map) override;
 
 	int32_t handle_undo_impl(const Widelands::World& world,
-	                         Widelands::NodeAndTriangle<> center,
+	                         const Widelands::NodeAndTriangle<>& center,
 	                         EditorInteractive& parent,
 	                         EditorActionArgs* args,
 							 Widelands::Map* map) override;

=== modified file 'src/editor/tools/draw_tool.cc'
--- src/editor/tools/draw_tool.cc	2016-04-06 09:23:04 +0000
+++ src/editor/tools/draw_tool.cc	2016-07-24 14:17:53 +0000
@@ -35,7 +35,7 @@
 
 int32_t
 EditorDrawTool::handle_click_impl(const Widelands::World& world,
-                                  Widelands::NodeAndTriangle<Widelands::Coords> /* center */,
+                                  const Widelands::NodeAndTriangle<Widelands::Coords>& /* center */,
                                   EditorInteractive& /* parent */,
                                   EditorActionArgs* args,
 								  Widelands::Map* /* map */) {
@@ -54,7 +54,7 @@
 
 int32_t
 EditorDrawTool::handle_undo_impl(const Widelands::World& world,
-                                 Widelands::NodeAndTriangle<Widelands::Coords> /* center */,
+                                 const Widelands::NodeAndTriangle<Widelands::Coords>& /* center */,
                                  EditorInteractive& /* parent */,
                                  EditorActionArgs* args,
 								 Widelands::Map* /* map */) {

=== modified file 'src/editor/tools/draw_tool.h'
--- src/editor/tools/draw_tool.h	2016-04-06 09:23:04 +0000
+++ src/editor/tools/draw_tool.h	2016-07-24 14:17:53 +0000
@@ -29,13 +29,13 @@
 	EditorDrawTool() : EditorTool(*this, *this) {}
 
 	int32_t handle_click_impl(const Widelands::World& world,
-	                          Widelands::NodeAndTriangle<> center,
+	                          const Widelands::NodeAndTriangle<>& center,
 	                          EditorInteractive& parent,
 	                          EditorActionArgs* args,
 							  Widelands::Map* map) override;
 
 	int32_t handle_undo_impl(const Widelands::World& world,
-	                         Widelands::NodeAndTriangle<> center,
+	                         const Widelands::NodeAndTriangle<>& center,
 	                         EditorInteractive& parent,
 	                         EditorActionArgs* args,
 							 Widelands::Map* map) override;

=== modified file 'src/editor/tools/history.cc'
--- src/editor/tools/history.cc	2016-04-11 06:45:29 +0000
+++ src/editor/tools/history.cc	2016-07-24 14:17:53 +0000
@@ -96,7 +96,7 @@
 											  EditorTool::ToolIndex ind,
                                    Widelands::Map& map,
                                    const Widelands::World& world,
-                                   const Widelands::NodeAndTriangle<Widelands::Coords> center,
+                                   const Widelands::NodeAndTriangle<Widelands::Coords>& center,
 											  EditorInteractive& parent,
                                    bool draw) {
 	EditorToolAction ac

=== modified file 'src/editor/tools/history.h'
--- src/editor/tools/history.h	2016-04-06 09:23:04 +0000
+++ src/editor/tools/history.h	2016-07-24 14:17:53 +0000
@@ -41,7 +41,7 @@
 							 EditorTool::ToolIndex ind,
 	                   Widelands::Map& map,
 	                   const Widelands::World& world,
-	                   Widelands::NodeAndTriangle<> const center,
+	                   const Widelands::NodeAndTriangle<>& center,
 							 EditorInteractive& parent,
 	                   bool draw = false);
 	uint32_t undo_action(const Widelands::World& world);

=== modified file 'src/editor/tools/increase_height_tool.cc'
--- src/editor/tools/increase_height_tool.cc	2016-04-06 09:23:04 +0000
+++ src/editor/tools/increase_height_tool.cc	2016-07-24 14:17:53 +0000
@@ -26,7 +26,7 @@
 
 /// Increases the heights by a value. Changes surrounding nodes if necessary.
 int32_t EditorIncreaseHeightTool::handle_click_impl(const Widelands::World& world,
-                                                    Widelands::NodeAndTriangle<> center,
+                                                    const Widelands::NodeAndTriangle<>& center,
                                                     EditorInteractive& /* parent */,
                                                     EditorActionArgs* args,
 													Widelands::Map* map) {
@@ -48,7 +48,7 @@
 }
 
 int32_t EditorIncreaseHeightTool::handle_undo_impl(const Widelands::World& world,
-                                                   Widelands::NodeAndTriangle<> center,
+                                                   const Widelands::NodeAndTriangle<>& center,
                                                    EditorInteractive& parent,
                                                    EditorActionArgs* args,
 												   Widelands::Map* map) {

=== modified file 'src/editor/tools/increase_height_tool.h'
--- src/editor/tools/increase_height_tool.h	2016-04-06 09:23:04 +0000
+++ src/editor/tools/increase_height_tool.h	2016-07-24 14:17:53 +0000
@@ -35,13 +35,13 @@
 	{}
 
 	int32_t handle_click_impl(const Widelands::World& world,
-	                          Widelands::NodeAndTriangle<> center,
+	                          const Widelands::NodeAndTriangle<>& center,
 	                          EditorInteractive& parent,
 	                          EditorActionArgs* args,
 							  Widelands::Map* map) override;
 
 	int32_t handle_undo_impl(const Widelands::World& world,
-	                         Widelands::NodeAndTriangle<> center,
+	                         const Widelands::NodeAndTriangle<>& center,
 	                         EditorInteractive& parent,
 	                         EditorActionArgs* args,
 							 Widelands::Map* map) override;

=== modified file 'src/editor/tools/increase_resources_tool.cc'
--- src/editor/tools/increase_resources_tool.cc	2016-04-11 06:45:29 +0000
+++ src/editor/tools/increase_resources_tool.cc	2016-07-24 14:17:53 +0000
@@ -30,7 +30,7 @@
 using Widelands::TCoords;
 
 int32_t EditorIncreaseResourcesTool::handle_click_impl(const Widelands::World& world,
-                                                       Widelands::NodeAndTriangle<> const center,
+                                                       const Widelands::NodeAndTriangle<>& center,
                                                        EditorInteractive& /* parent */,
                                                        EditorActionArgs* args,
                                                        Widelands::Map* map) {
@@ -65,7 +65,7 @@
 }
 
 int32_t EditorIncreaseResourcesTool::handle_undo_impl(const Widelands::World& world,
-		                                              Widelands::NodeAndTriangle<Widelands::Coords> center,
+		                                              const Widelands::NodeAndTriangle<Widelands::Coords>& center,
 													  EditorInteractive& parent,
 													  EditorActionArgs* args,
 													  Widelands::Map* map) {

=== modified file 'src/editor/tools/increase_resources_tool.h'
--- src/editor/tools/increase_resources_tool.h	2016-04-06 09:23:04 +0000
+++ src/editor/tools/increase_resources_tool.h	2016-07-24 14:17:53 +0000
@@ -40,13 +40,13 @@
 	 * another resource there.
 	 */
 	int32_t handle_click_impl(const Widelands::World& world,
-	                          Widelands::NodeAndTriangle<> center,
+	                          const Widelands::NodeAndTriangle<>& center,
 	                          EditorInteractive& parent,
 	                          EditorActionArgs* args,
 							  Widelands::Map* map) override;
 
 	int32_t handle_undo_impl(const Widelands::World& world,
-	                         Widelands::NodeAndTriangle<> center,
+	                         const Widelands::NodeAndTriangle<>& center,
 	                         EditorInteractive& parent,
 	                         EditorActionArgs* args,
 							 Widelands::Map* map) override;

=== modified file 'src/editor/tools/info_tool.cc'
--- src/editor/tools/info_tool.cc	2016-04-11 06:45:29 +0000
+++ src/editor/tools/info_tool.cc	2016-07-24 14:17:53 +0000
@@ -35,7 +35,7 @@
 
 /// Show a window with information about the pointed at node and triangle.
 int32_t EditorInfoTool::handle_click_impl(const Widelands::World& world,
-										 Widelands::NodeAndTriangle<> center,
+										 const Widelands::NodeAndTriangle<>& center,
 										 EditorInteractive& parent,
 										 EditorActionArgs* /* args */,
 										 Widelands::Map* map) {

=== modified file 'src/editor/tools/info_tool.h'
--- src/editor/tools/info_tool.h	2016-04-06 09:23:04 +0000
+++ src/editor/tools/info_tool.h	2016-07-24 14:17:53 +0000
@@ -28,7 +28,7 @@
 	}
 
 	int32_t handle_click_impl(const Widelands::World& world,
-	                          Widelands::NodeAndTriangle<> center,
+	                          const Widelands::NodeAndTriangle<>& center,
 	                          EditorInteractive& parent,
 	                          EditorActionArgs* args,
 							  Widelands::Map* map) override;

=== modified file 'src/editor/tools/make_infrastructure_tool.cc'
--- src/editor/tools/make_infrastructure_tool.cc	2016-04-06 09:23:04 +0000
+++ src/editor/tools/make_infrastructure_tool.cc	2016-07-24 14:17:53 +0000
@@ -47,7 +47,7 @@
  * Obviously, this function ignores the sel radius
 */
 int32_t EditorMakeInfrastructureTool::handle_click_impl(const Widelands::World&,
-                                                        Widelands::NodeAndTriangle<> const,
+                                                        const Widelands::NodeAndTriangle<>&,
                                                         EditorInteractive& parent,
                                                         EditorActionArgs* /* args */,
 														Widelands::Map*) {

=== modified file 'src/editor/tools/make_infrastructure_tool.h'
--- src/editor/tools/make_infrastructure_tool.h	2016-04-06 09:23:04 +0000
+++ src/editor/tools/make_infrastructure_tool.h	2016-07-24 14:17:53 +0000
@@ -40,7 +40,7 @@
 		{return player_;}
 
 	int32_t handle_click_impl(const Widelands::World& world,
-	                          Widelands::NodeAndTriangle<> center,
+	                          const Widelands::NodeAndTriangle<>& center,
 	                          EditorInteractive& parent,
 	                          EditorActionArgs* args,
 							  Widelands::Map* map) override;

=== modified file 'src/editor/tools/noise_height_tool.cc'
--- src/editor/tools/noise_height_tool.cc	2016-04-06 09:23:04 +0000
+++ src/editor/tools/noise_height_tool.cc	2016-07-24 14:17:53 +0000
@@ -28,7 +28,7 @@
 
 /// Sets the heights to random values. Changes surrounding nodes if necessary.
 int32_t EditorNoiseHeightTool::handle_click_impl(const Widelands::World& world,
-                                                 Widelands::NodeAndTriangle<> const center,
+                                                 const Widelands::NodeAndTriangle<>& center,
                                                  EditorInteractive& /* parent */,
                                                  EditorActionArgs* args,
 												 Widelands::Map* map) {
@@ -63,7 +63,7 @@
 
 int32_t
 EditorNoiseHeightTool::handle_undo_impl(const Widelands::World& world,
-                                        Widelands::NodeAndTriangle<Widelands::Coords> center,
+                                        const Widelands::NodeAndTriangle<Widelands::Coords>& center,
                                         EditorInteractive& parent,
                                         EditorActionArgs* args,
 										Widelands::Map* map) {

=== modified file 'src/editor/tools/noise_height_tool.h'
--- src/editor/tools/noise_height_tool.h	2016-04-06 09:23:04 +0000
+++ src/editor/tools/noise_height_tool.h	2016-07-24 14:17:53 +0000
@@ -26,7 +26,7 @@
 struct EditorNoiseHeightTool : public EditorTool {
 	EditorNoiseHeightTool
 	(EditorSetHeightTool & the_set_tool,
-	 const Widelands::HeightInterval the_interval =
+	 const Widelands::HeightInterval& the_interval =
 	     Widelands::HeightInterval(10, 14))
 		:
 		EditorTool(the_set_tool, the_set_tool),
@@ -35,13 +35,13 @@
 	{}
 
 	int32_t handle_click_impl(const Widelands::World& world,
-	                          Widelands::NodeAndTriangle<> center,
+	                          const Widelands::NodeAndTriangle<>& center,
 	                          EditorInteractive& parent,
 	                          EditorActionArgs* args,
 							  Widelands::Map* map) override;
 
 	int32_t handle_undo_impl(const Widelands::World& world,
-	                         Widelands::NodeAndTriangle<> center,
+	                         const Widelands::NodeAndTriangle<>& center,
 	                         EditorInteractive& parent,
 	                         EditorActionArgs* args,
 							 Widelands::Map* map) override;
@@ -55,7 +55,7 @@
 	Widelands::HeightInterval get_interval() const {
 		return interval_;
 	}
-	void set_interval(Widelands::HeightInterval const i) {
+	void set_interval(const Widelands::HeightInterval& i) {
 		interval_ = i;
 	}
 

=== modified file 'src/editor/tools/place_bob_tool.cc'
--- src/editor/tools/place_bob_tool.cc	2016-04-06 09:23:04 +0000
+++ src/editor/tools/place_bob_tool.cc	2016-07-24 14:17:53 +0000
@@ -31,7 +31,7 @@
  * and places this on the current field
 */
 int32_t EditorPlaceBobTool::handle_click_impl(const Widelands::World& world,
-                                              Widelands::NodeAndTriangle<> const center,
+                                              const Widelands::NodeAndTriangle<>& center,
                                               EditorInteractive& parent,
                                               EditorActionArgs* args,
 											  Widelands::Map* map) {
@@ -71,7 +71,7 @@
 
 int32_t
 EditorPlaceBobTool::handle_undo_impl(const Widelands::World&,
-                                     Widelands::NodeAndTriangle<Widelands::Coords> center,
+                                     const Widelands::NodeAndTriangle<Widelands::Coords>& center,
                                      EditorInteractive& parent,
                                      EditorActionArgs* args,
 									 Widelands::Map* map) {

=== modified file 'src/editor/tools/place_bob_tool.h'
--- src/editor/tools/place_bob_tool.h	2016-04-06 09:23:04 +0000
+++ src/editor/tools/place_bob_tool.h	2016-07-24 14:17:53 +0000
@@ -30,13 +30,13 @@
 	{}
 
 	int32_t handle_click_impl(const Widelands::World& world,
-	                          Widelands::NodeAndTriangle<> center,
+	                          const Widelands::NodeAndTriangle<>& center,
 	                          EditorInteractive& parent,
 	                          EditorActionArgs* args,
 							  Widelands::Map* map) override;
 
 	int32_t handle_undo_impl(const Widelands::World& world,
-	                         Widelands::NodeAndTriangle<> center,
+	                         const Widelands::NodeAndTriangle<>& center,
 	                         EditorInteractive& parent,
 	                         EditorActionArgs* args,
 							 Widelands::Map* map) override;

=== modified file 'src/editor/tools/place_immovable_tool.cc'
--- src/editor/tools/place_immovable_tool.cc	2016-04-11 06:45:29 +0000
+++ src/editor/tools/place_immovable_tool.cc	2016-07-24 14:17:53 +0000
@@ -33,7 +33,7 @@
  * and places this on the current field
 */
 int32_t EditorPlaceImmovableTool::handle_click_impl(const Widelands::World&,
-                                                    Widelands::NodeAndTriangle<> const center,
+                                                    const Widelands::NodeAndTriangle<>& center,
                                                     EditorInteractive& parent,
                                                     EditorActionArgs* args,
 													Widelands::Map* map) {
@@ -74,7 +74,7 @@
 }
 
 int32_t EditorPlaceImmovableTool::handle_undo_impl(const Widelands::World&,
-												   Widelands::NodeAndTriangle<Widelands::Coords> center,
+												   const Widelands::NodeAndTriangle<Widelands::Coords>& center,
 												   EditorInteractive& parent,
 												   EditorActionArgs* args,
 												   Widelands::Map* map) {

=== modified file 'src/editor/tools/place_immovable_tool.h'
--- src/editor/tools/place_immovable_tool.h	2016-04-06 09:23:04 +0000
+++ src/editor/tools/place_immovable_tool.h	2016-07-24 14:17:53 +0000
@@ -32,13 +32,13 @@
 	{}
 
 	int32_t handle_click_impl(const Widelands::World& world,
-	                          Widelands::NodeAndTriangle<> center,
+	                          const Widelands::NodeAndTriangle<>& center,
 	                          EditorInteractive& parent,
 	                          EditorActionArgs* args,
 							  Widelands::Map* map) override;
 
 	int32_t handle_undo_impl(const Widelands::World& world,
-	                         Widelands::NodeAndTriangle<> center,
+	                         const Widelands::NodeAndTriangle<>& center,
 	                         EditorInteractive& parent,
 	                         EditorActionArgs* args,
 							 Widelands::Map* map) override;

=== modified file 'src/editor/tools/set_height_tool.cc'
--- src/editor/tools/set_height_tool.cc	2016-04-06 09:23:04 +0000
+++ src/editor/tools/set_height_tool.cc	2016-07-24 14:17:53 +0000
@@ -27,7 +27,7 @@
 #include "logic/mapregion.h"
 
 int32_t EditorSetHeightTool::handle_click_impl(const Widelands::World& world,
-                                               Widelands::NodeAndTriangle<> const center,
+                                               const Widelands::NodeAndTriangle<>& center,
                                                EditorInteractive& /* parent */,
                                                EditorActionArgs* args,
 											   Widelands::Map* map) {
@@ -48,7 +48,7 @@
 
 int32_t
 EditorSetHeightTool::handle_undo_impl(const Widelands::World& world,
-                                      Widelands::NodeAndTriangle<Widelands::Coords> center,
+                                      const Widelands::NodeAndTriangle<Widelands::Coords>& center,
                                       EditorInteractive& /* parent */,
                                       EditorActionArgs* args,
 									  Widelands::Map* map) {

=== modified file 'src/editor/tools/set_height_tool.h'
--- src/editor/tools/set_height_tool.h	2016-04-06 09:23:04 +0000
+++ src/editor/tools/set_height_tool.h	2016-07-24 14:17:53 +0000
@@ -31,13 +31,13 @@
 	{}
 
 	int32_t handle_click_impl(const Widelands::World& world,
-	                          Widelands::NodeAndTriangle<> center,
+	                          const Widelands::NodeAndTriangle<>& center,
 	                          EditorInteractive& parent,
 	                          EditorActionArgs* args,
 							  Widelands::Map* map) override;
 
 	int32_t handle_undo_impl(const Widelands::World& world,
-	                         Widelands::NodeAndTriangle<> center,
+	                         const Widelands::NodeAndTriangle<>& center,
 	                         EditorInteractive& parent,
 	                         EditorActionArgs* args,
 							 Widelands::Map* map) override;
@@ -51,7 +51,7 @@
 	Widelands::HeightInterval get_interval() const {
 		return interval_;
 	}
-	void set_interval(Widelands::HeightInterval const i) {
+	void set_interval(const Widelands::HeightInterval& i) {
 		interval_ = i;
 	}
 

=== modified file 'src/editor/tools/set_origin_tool.cc'
--- src/editor/tools/set_origin_tool.cc	2016-04-06 18:28:04 +0000
+++ src/editor/tools/set_origin_tool.cc	2016-07-24 14:17:53 +0000
@@ -24,7 +24,7 @@
 #include "wui/mapviewpixelconstants.h"
 
 int32_t EditorSetOriginTool::handle_click_impl(const Widelands::World&,
-                                               Widelands::NodeAndTriangle<> const center,
+                                               const Widelands::NodeAndTriangle<>& center,
                                                EditorInteractive& eia,
                                                EditorActionArgs* /* args */,
 											   Widelands::Map* map) {
@@ -40,7 +40,7 @@
 
 int32_t
 EditorSetOriginTool::handle_undo_impl(const Widelands::World&,
-                                      Widelands::NodeAndTriangle<Widelands::Coords> center,
+                                      const Widelands::NodeAndTriangle<Widelands::Coords>& center,
                                       EditorInteractive& eia,
                                       EditorActionArgs* /* args */,
 									  Widelands::Map* map) {

=== modified file 'src/editor/tools/set_origin_tool.h'
--- src/editor/tools/set_origin_tool.h	2016-04-06 09:23:04 +0000
+++ src/editor/tools/set_origin_tool.h	2016-07-24 14:17:53 +0000
@@ -28,13 +28,13 @@
 	EditorSetOriginTool() : EditorTool(*this, *this) {}
 
 	int32_t handle_click_impl(const Widelands::World& world,
-	                          Widelands::NodeAndTriangle<> center,
+	                          const Widelands::NodeAndTriangle<>& center,
 	                          EditorInteractive& eia,
 	                          EditorActionArgs* args,
 							  Widelands::Map* map) override;
 
 	int32_t handle_undo_impl(const Widelands::World& world,
-	                         Widelands::NodeAndTriangle<> center,
+	                         const Widelands::NodeAndTriangle<>& center,
 	                         EditorInteractive& parent,
 	                         EditorActionArgs* args,
 							 Widelands::Map* map) override;

=== modified file 'src/editor/tools/set_port_space_tool.cc'
--- src/editor/tools/set_port_space_tool.cc	2016-04-06 12:52:09 +0000
+++ src/editor/tools/set_port_space_tool.cc	2016-07-24 14:17:53 +0000
@@ -55,7 +55,7 @@
 {}
 
 int32_t EditorSetPortSpaceTool::handle_click_impl(const Widelands::World& world,
-                                                  Widelands::NodeAndTriangle<> const center,
+                                                  const Widelands::NodeAndTriangle<>& center,
                                                   EditorInteractive&,
                                                   EditorActionArgs* args,
 												  Map* map) {
@@ -82,7 +82,7 @@
 }
 
 int32_t EditorSetPortSpaceTool::handle_undo_impl(const Widelands::World& world,
-                                                 NodeAndTriangle<Coords> center,
+                                                 const NodeAndTriangle<Coords>& center,
                                                  EditorInteractive& parent,
                                                  EditorActionArgs* args,
 												 Map* map) {
@@ -90,7 +90,7 @@
 }
 
 int32_t EditorUnsetPortSpaceTool::handle_click_impl(const Widelands::World& world,
-                                                    NodeAndTriangle<> const center,
+                                                    const Widelands::NodeAndTriangle<>& center,
                                                     EditorInteractive&,
                                                     EditorActionArgs* args,
 													Map* map) {
@@ -117,7 +117,7 @@
 }
 
 int32_t EditorUnsetPortSpaceTool::handle_undo_impl(const Widelands::World& world,
-                                                   NodeAndTriangle<Coords> center,
+                                                   const NodeAndTriangle<Coords>& center,
                                                    EditorInteractive& parent,
                                                    EditorActionArgs* args,
 												   Map* map) {

=== modified file 'src/editor/tools/set_port_space_tool.h'
--- src/editor/tools/set_port_space_tool.h	2016-04-06 09:23:04 +0000
+++ src/editor/tools/set_port_space_tool.h	2016-07-24 14:17:53 +0000
@@ -32,13 +32,13 @@
 	EditorUnsetPortSpaceTool();
 
 	int32_t handle_click_impl(const Widelands::World& world,
-	                          Widelands::NodeAndTriangle<> center,
+	                          const Widelands::NodeAndTriangle<>& center,
 	                          EditorInteractive& parent,
 	                          EditorActionArgs* args,
 							  Widelands::Map* map) override;
 
 	int32_t handle_undo_impl(const Widelands::World& world,
-	                         Widelands::NodeAndTriangle<> center,
+	                         const Widelands::NodeAndTriangle<>& center,
 	                         EditorInteractive& parent,
 	                         EditorActionArgs* args,
 							 Widelands::Map* map) override;
@@ -53,13 +53,13 @@
 	EditorSetPortSpaceTool(EditorUnsetPortSpaceTool &);
 
 	int32_t handle_click_impl(const Widelands::World& world,
-	                          Widelands::NodeAndTriangle<> center,
+	                          const Widelands::NodeAndTriangle<>& center,
 	                          EditorInteractive& parent,
 	                          EditorActionArgs* args,
 							  Widelands::Map* map) override;
 
 	int32_t handle_undo_impl(const Widelands::World& world,
-	                         Widelands::NodeAndTriangle<> center,
+	                         const Widelands::NodeAndTriangle<>& center,
 	                         EditorInteractive& parent,
 	                         EditorActionArgs* args,
 							 Widelands::Map* map) override;

=== modified file 'src/editor/tools/set_resources_tool.cc'
--- src/editor/tools/set_resources_tool.cc	2016-04-14 16:03:22 +0000
+++ src/editor/tools/set_resources_tool.cc	2016-07-24 14:17:53 +0000
@@ -29,7 +29,7 @@
 #include "logic/mapregion.h"
 
 int32_t EditorSetResourcesTool::handle_click_impl(const Widelands::World& world,
-                                                  Widelands::NodeAndTriangle<> const center,
+                                                  const Widelands::NodeAndTriangle<>& center,
                                                   EditorInteractive& /* parent */,
                                                   EditorActionArgs* args,
                                                   Widelands::Map* map) {
@@ -62,7 +62,7 @@
 
 int32_t
 EditorSetResourcesTool::handle_undo_impl(const Widelands::World& world,
-                                         Widelands::NodeAndTriangle<Widelands::Coords> /* center */,
+                                         const Widelands::NodeAndTriangle<Widelands::Coords>& /* center */,
                                          EditorInteractive& /* parent */,
                                          EditorActionArgs* args,
                                          Widelands::Map* map) {

=== modified file 'src/editor/tools/set_resources_tool.h'
--- src/editor/tools/set_resources_tool.h	2016-04-11 06:45:29 +0000
+++ src/editor/tools/set_resources_tool.h	2016-07-24 14:17:53 +0000
@@ -34,13 +34,13 @@
 	 * Sets the resources of the current to a fixed value
 	*/
 	int32_t handle_click_impl(const Widelands::World& world,
-	                          Widelands::NodeAndTriangle<> center,
+	                          const Widelands::NodeAndTriangle<>& center,
 	                          EditorInteractive& parent,
 	                          EditorActionArgs* args,
 							  Widelands::Map* map) override;
 
 	int32_t handle_undo_impl(const Widelands::World& world,
-	                         Widelands::NodeAndTriangle<> center,
+	                         const Widelands::NodeAndTriangle<>& center,
 	                         EditorInteractive& parent,
 	                         EditorActionArgs* args,
 							 Widelands::Map* map) override;

=== modified file 'src/editor/tools/set_starting_pos_tool.cc'
--- src/editor/tools/set_starting_pos_tool.cc	2016-05-04 06:28:27 +0000
+++ src/editor/tools/set_starting_pos_tool.cc	2016-07-24 14:17:53 +0000
@@ -89,7 +89,7 @@
 }
 
 int32_t EditorSetStartingPosTool::handle_click_impl(const Widelands::World&,
-                                                    Widelands::NodeAndTriangle<> const center,
+                                                    const Widelands::NodeAndTriangle<>& center,
                                                     EditorInteractive& eia,
                                                     EditorActionArgs*,
 													Widelands::Map* map) {

=== modified file 'src/editor/tools/set_starting_pos_tool.h'
--- src/editor/tools/set_starting_pos_tool.h	2016-04-06 09:23:04 +0000
+++ src/editor/tools/set_starting_pos_tool.h	2016-07-24 14:17:53 +0000
@@ -33,7 +33,7 @@
 	EditorSetStartingPosTool();
 
 	int32_t handle_click_impl(const Widelands::World& world,
-	                          Widelands::NodeAndTriangle<>,
+	                          const Widelands::NodeAndTriangle<>&,
 	                          EditorInteractive&,
 	                          EditorActionArgs*,
 							  Widelands::Map*) override;

=== modified file 'src/editor/tools/set_terrain_tool.cc'
--- src/editor/tools/set_terrain_tool.cc	2016-04-06 09:23:04 +0000
+++ src/editor/tools/set_terrain_tool.cc	2016-07-24 14:17:53 +0000
@@ -26,7 +26,7 @@
 using Widelands::TCoords;
 
 int32_t EditorSetTerrainTool::handle_click_impl(const Widelands::World& world,
-                                                Widelands::NodeAndTriangle<> const center,
+                                                const Widelands::NodeAndTriangle<>& center,
                                                 EditorInteractive& /* parent */,
                                                 EditorActionArgs* args,
 												Widelands::Map* map) {
@@ -69,7 +69,7 @@
 
 int32_t
 EditorSetTerrainTool::handle_undo_impl(const Widelands::World& world,
-                                       Widelands::NodeAndTriangle<Widelands::Coords> center,
+                                       const Widelands::NodeAndTriangle<Widelands::Coords>& center,
                                        EditorInteractive& /* parent */,
                                        EditorActionArgs* args,
 									   Widelands::Map* map) {

=== modified file 'src/editor/tools/set_terrain_tool.h'
--- src/editor/tools/set_terrain_tool.h	2016-04-06 09:23:04 +0000
+++ src/editor/tools/set_terrain_tool.h	2016-07-24 14:17:53 +0000
@@ -27,13 +27,13 @@
 	EditorSetTerrainTool() : EditorTool(*this, *this) {}
 
 	int32_t handle_click_impl(const Widelands::World& world,
-	                          Widelands::NodeAndTriangle<> center,
+	                          const Widelands::NodeAndTriangle<>& center,
 	                          EditorInteractive& parent,
 	                          EditorActionArgs* args,
 							  Widelands::Map* map) override;
 
 	int32_t handle_undo_impl(const Widelands::World& world,
-	                         Widelands::NodeAndTriangle<> center,
+	                         const Widelands::NodeAndTriangle<>& center,
 	                         EditorInteractive& parent,
 	                         EditorActionArgs* args,
 							 Widelands::Map* map) override;

=== modified file 'src/editor/tools/tool.h'
--- src/editor/tools/tool.h	2016-04-06 09:23:04 +0000
+++ src/editor/tools/tool.h	2016-07-24 14:17:53 +0000
@@ -48,7 +48,7 @@
 	enum ToolIndex {First, Second, Third};
 	int32_t handle_click
 		(ToolIndex i,
-		const Widelands::World& world, Widelands::NodeAndTriangle<> const center,
+		const Widelands::World& world, const Widelands::NodeAndTriangle<>& center,
 		EditorInteractive& parent, EditorActionArgs* args, Widelands::Map* map)
 	{
 		return
@@ -58,7 +58,7 @@
 
 	int32_t handle_undo
 		(ToolIndex i,
-		const Widelands::World& world, Widelands::NodeAndTriangle<> const center,
+		const Widelands::World& world, const Widelands::NodeAndTriangle<>& center,
 		EditorInteractive& parent, EditorActionArgs* args, Widelands::Map* map)
 	{
 		return
@@ -84,12 +84,12 @@
 		return EditorActionArgs(parent);
 	}
 	virtual int32_t handle_click_impl(const Widelands::World& world,
-	                                  Widelands::NodeAndTriangle<>,
+	                                  const Widelands::NodeAndTriangle<>&,
 	                                  EditorInteractive&,
 	                                  EditorActionArgs*,
 									  Widelands::Map*) = 0;
 	virtual int32_t handle_undo_impl(const Widelands::World&,
-	                                 Widelands::NodeAndTriangle<>,
+	                                 const Widelands::NodeAndTriangle<>&,
 	                                 EditorInteractive&,
 	                                 EditorActionArgs*,
 									 Widelands::Map*) {


Follow ups