diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-01-13 11:52:25 -0500 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-01-13 11:52:25 -0500 |
commit | 6db7cd19b6ea4f9aea785e84c3c178fdc163ba08 (patch) | |
tree | fd4855dcd09926786ac095cbd7d8e7b1b5c87150 /src/lib/Server/Lint/MergeFiles.py | |
parent | 56292eaac58c78a7e89d3c264b13b348e5d65a8f (diff) | |
download | bcfg2-6db7cd19b6ea4f9aea785e84c3c178fdc163ba08.tar.gz bcfg2-6db7cd19b6ea4f9aea785e84c3c178fdc163ba08.tar.bz2 bcfg2-6db7cd19b6ea4f9aea785e84c3c178fdc163ba08.zip |
cherry-picked a2cc392 Switch to shallow rather than deep copies to improve performance
Diffstat (limited to 'src/lib/Server/Lint/MergeFiles.py')
-rw-r--r-- | src/lib/Server/Lint/MergeFiles.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/Server/Lint/MergeFiles.py b/src/lib/Server/Lint/MergeFiles.py index 52fea3d9b..ff6e3449a 100644 --- a/src/lib/Server/Lint/MergeFiles.py +++ b/src/lib/Server/Lint/MergeFiles.py @@ -1,5 +1,5 @@ import os -from copy import deepcopy +import copy from difflib import SequenceMatcher import Bcfg2.Server.Lint @@ -43,7 +43,7 @@ class MergeFiles(Bcfg2.Server.Lint.ServerPlugin): rv = [] elist = entries.items() while elist: - result = self._find_similar(elist.pop(0), deepcopy(elist), + result = self._find_similar(elist.pop(0), copy.copy(elist), threshold) if len(result) > 1: elist = [(fname, fdata) @@ -62,7 +62,7 @@ class MergeFiles(Bcfg2.Server.Lint.ServerPlugin): if (sm.real_quick_ratio() > threshold and sm.quick_ratio() > threshold and sm.ratio() > threshold): - rv.extend(self._find_similar((cname, cdata), deepcopy(others), + rv.extend(self._find_similar((cname, cdata), copy.copy(others), threshold)) return rv |