From e03bb7162b355e6d736ad48b2cc2bbbc3e166171 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 30 Dec 2015 13:24:48 +0000 Subject: coverity#1326717 DLS: Dead local store Change-Id: I3467c9cdd39c8de4d3a10e4bb19c488ae4a6b9f2 --- .../xmerge/merger/diff/IteratorLCSAlgorithm.java | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'xmerge/source') 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 +} -- cgit