summaryrefslogtreecommitdiff
path: root/xmerge/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-12-30 13:24:48 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-12-30 13:34:23 +0000
commite03bb7162b355e6d736ad48b2cc2bbbc3e166171 (patch)
treeb5f398c20938c2c88d227a0bddaf10c47e7ac431 /xmerge/source
parent1876d9a807ee0b3480ab108273930897cc697d88 (diff)
coverity#1326717 DLS: Dead local store
Change-Id: I3467c9cdd39c8de4d3a10e4bb19c488ae4a6b9f2
Diffstat (limited to 'xmerge/source')
-rw-r--r--xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/IteratorLCSAlgorithm.java17
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
+}