diff options
author | Noel Grandin <noel@peralex.com> | 2015-10-14 12:02:17 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-10-14 12:09:14 +0200 |
commit | 3c496d8042614718042e46b66e32e860a39abac1 (patch) | |
tree | 5a88aeb309bc2c6da62a1b10696053eaef11531c /xmerge | |
parent | f3ef91fde2994db54eec9a1323d4d9cf91b991f2 (diff) |
cid#1326716,cid#1326717 DLS: Dead local store
and clean up the method a little
Change-Id: Iaa27bcd20a5b5b1b2b14f277371c5a013ae5d339
Diffstat (limited to 'xmerge')
-rw-r--r-- | xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/CharArrayLCSAlgorithm.java | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/CharArrayLCSAlgorithm.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/CharArrayLCSAlgorithm.java index 1501bd3f3556..94c2bea396cd 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/CharArrayLCSAlgorithm.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/CharArrayLCSAlgorithm.java @@ -47,27 +47,18 @@ public class CharArrayLCSAlgorithm { int orgSeqlen = orgSeq.length; int modSeqlen = modSeq.length; - int[][] diffTable; - // Diff table is used to keep track which element is the same or not // in those 2 sequences - diffTable = createDiffTable(orgSeq, modSeq); + int[][] diffTable = createDiffTable(orgSeq, modSeq); ArrayList<Difference> diffResult = new ArrayList<Difference>(); generateResult(diffTable, orgSeqlen, modSeqlen, diffResult); - Difference[] diffArray = new Difference[0]; - - // convert the vector to array, it has to do in here as + // convert the vector to array, it has to do it here as // generateResult is called recursively - if (diffResult.size() > 0) { - diffArray = new Difference[diffResult.size()]; - diffResult.toArray(diffArray); - } - - diffTable = null; - diffResult = null; + Difference[] diffArray = new Difference[diffResult.size()]; + diffResult.toArray(diffArray); return diffArray; } |