From a416f3a4e44c928f70e8c789e1ea8a7db24886b9 Mon Sep 17 00:00:00 2001 From: Chris Pavlina Date: Sun, 19 Feb 2017 22:13:50 -0500 Subject: [PATCH] Remove unnecessary TRANSFORM::operator= The default assignment operator is significantly more efficient - often inlined, and has no branches... --- eeschema/transform.cpp | 15 +-------------- eeschema/transform.h | 4 +--- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/eeschema/transform.cpp b/eeschema/transform.cpp index 53aac2d0a5..9df77be541 100644 --- a/eeschema/transform.cpp +++ b/eeschema/transform.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2010 Wayne Stambaugh - * Copyright (C) 2015 KiCad Developers, see CHANGELOG.TXT for contributors. + * Copyright (C) 2015-2017 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -29,19 +29,6 @@ #include -TRANSFORM& TRANSFORM::operator=( const TRANSFORM& aTransform ) -{ - if( this == &aTransform ) // Check for self assingnemt; - return *this; - - x1 = aTransform.x1; - y1 = aTransform.y1; - x2 = aTransform.x2; - y2 = aTransform.y2; - return *this; -} - - bool TRANSFORM::operator==( const TRANSFORM& aTransform ) const { return ( x1 == aTransform.x1 && diff --git a/eeschema/transform.h b/eeschema/transform.h index 35ee6eae86..13e93e6557 100644 --- a/eeschema/transform.h +++ b/eeschema/transform.h @@ -6,7 +6,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2007-2010 Wayne Stambaugh - * Copyright (C) 2007 KiCad Developers, see change_log.txt for contributors. + * Copyright (C) 2007-2017 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -57,8 +57,6 @@ public: TRANSFORM( int ax1, int ay1, int ax2, int ay2 ) : x1( ax1 ), y1( ay1 ), x2( ax2 ), y2( ay2 ) {} - TRANSFORM& operator=( const TRANSFORM& aTransform ); - bool operator==( const TRANSFORM& aTransform ) const; bool operator!=( const TRANSFORM& aTransform ) const { return !( *this == aTransform ); }