From: Christophe Oosterlynck Date: Thu, 23 Oct 2008 10:15:06 +0000 (+0200) Subject: RadioGatun: fixed copy() method X-Git-Url: https://repo.or.cz/w/python-cryptoplus.git/commitdiff_plain/16a238fb526e3ab0e06c5a5e47f4465c6bb0d058 RadioGatun: fixed copy() method deepcopy can be used --- diff --git a/src/CryptoPlus/Hash/pyradiogatun.py b/src/CryptoPlus/Hash/pyradiogatun.py index d1edf8a..f733d23 100644 --- a/src/CryptoPlus/Hash/pyradiogatun.py +++ b/src/CryptoPlus/Hash/pyradiogatun.py @@ -278,14 +278,9 @@ class RadioGatunType: to efficiently compute the digests of strings that share a common initial substring. """ - if 0: # set this to 1 to make the flow space crash - return copy.deepcopy(self) - clone = self.__class__() - clone.length = self.length - clone.count = [] + self.count[:] - clone.input = "" + self.input - clone.S = self.S - return clone + + import copy + return copy.deepcopy(self) # ====================================================================== # TOP LEVEL INTERFACE