diff options
Diffstat (limited to 'xmerge')
-rw-r--r-- | xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/IteratorLCSAlgorithm.java | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/IteratorLCSAlgorithm.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/IteratorLCSAlgorithm.java index 909b6f50d4b2..d0957a8d5910 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/IteratorLCSAlgorithm.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/IteratorLCSAlgorithm.java @@ -38,11 +38,9 @@ public class IteratorLCSAlgorithm implements DiffAlgorithm { int orgSeqlen = orgSeq.elementCount(); int modSeqlen = modSeq.elementCount(); - 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); // debug purpose... if (Debug.isFlagSet(Debug.INFO)) { @@ -53,17 +51,10 @@ public class IteratorLCSAlgorithm implements DiffAlgorithm { generateResult(diffTable, orgSeqlen, modSeqlen, diffResult); - Difference[] diffArray = new Difference[0]; - // convert the vector to array, it has to do in 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; } @@ -218,4 +209,4 @@ public class IteratorLCSAlgorithm implements DiffAlgorithm { } } } -}
\ No newline at end of file +} |