diff options
| author | Alexander Shorin <kxepal@gmail.com> | 2011-12-25 16:38:35 +0400 |
|---|---|---|
| committer | Alexander Shorin <kxepal@gmail.com> | 2011-12-25 16:38:35 +0400 |
| commit | f3f3410ff91675215dfe531bf7596080885fe88d (patch) | |
| tree | 2e67afa9027703667fabd10ef999ce2b2a633250 /jsonpatch.py | |
| parent | f89f6393e2682ef6182c642b1f86b61a543980a0 (diff) | |
| download | python-json-patch-f3f3410ff91675215dfe531bf7596080885fe88d.tar.gz | |
Reduce patch applying cost.
Let the developer to decide does he wants to modify same object or copy of it. In other way test operation produces huge overhead for nothing.
Diffstat (limited to 'jsonpatch.py')
| -rw-r--r-- | jsonpatch.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/jsonpatch.py b/jsonpatch.py index f537136..be92fbe 100644 --- a/jsonpatch.py +++ b/jsonpatch.py @@ -39,7 +39,6 @@ __website__ = 'https://github.com/stefankoegl/python-json-patch' __license__ = 'Modified BSD License' -import copy import json @@ -85,9 +84,7 @@ class JsonPatch(object): def apply(self, obj): - """ Applies the patch to a copy of the given object """ - - obj = copy.deepcopy(obj) + """ Applies the patch to given object """ for operation in self.patch: op = self._get_operation(operation) |
