From afc11e985259320972c13f93c9251ff6e4e9fe7c Mon Sep 17 00:00:00 2001 From: Per A Brodtkorb Date: Tue, 22 Nov 2016 08:46:44 +0100 Subject: [PATCH] Removed similar code --- wafo/polynomial.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/wafo/polynomial.py b/wafo/polynomial.py index 1280a52..7f008f0 100644 --- a/wafo/polynomial.py +++ b/wafo/polynomial.py @@ -1637,22 +1637,16 @@ class Cheb1d(object): return self def __add__(self, other): - new, other = self._copy(other) + other = Cheb1d(other) + new = Cheb1d(self) new.coeffs = polyadd(self.coeffs, other.coeffs) return new def __radd__(self, other): return self.__add__(other) - def _copy(self, other): - other = Cheb1d(other) - new = Cheb1d(self) - return new, other - def __sub__(self, other): - new, other = self._copy(other) - new.coeffs = polysub(self.coeffs, other.coeffs) - return new + return self.__add__(-other) def __rsub__(self, other): new = self.__sub__(other)