summaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorBrian P. Hinz <bphinz@users.sf.net>2017-05-24 22:43:07 -0400
committerBrian P. Hinz <bphinz@users.sf.net>2017-05-24 23:34:19 -0400
commit93c1203f85d89fc2530785198977ab888c05c298 (patch)
treed09c566e17da642d82888c6ea212e53aa073a66e /java
parent37d371e225060fef6a1f18cd7fbaa82273f95f16 (diff)
downloadtigervnc-93c1203f85d89fc2530785198977ab888c05c298.tar.gz
tigervnc-93c1203f85d89fc2530785198977ab888c05c298.zip
Better checks for object equality, remove redundant initializer
Diffstat (limited to 'java')
-rw-r--r--java/com/tigervnc/rfb/DecodeManager.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/java/com/tigervnc/rfb/DecodeManager.java b/java/com/tigervnc/rfb/DecodeManager.java
index c1557460..98d0f63c 100644
--- a/java/com/tigervnc/rfb/DecodeManager.java
+++ b/java/com/tigervnc/rfb/DecodeManager.java
@@ -144,7 +144,6 @@ public class DecodeManager {
entry.cp = conn.cp;
entry.pb = pb;
entry.bufferStream = bufferStream;
- entry.affectedRegion = new Region(r);
decoder.getAffectedRegion(r, bufferStream.data(),
bufferStream.length(), conn.cp,
@@ -209,6 +208,7 @@ public class DecodeManager {
private class QueueEntry {
public QueueEntry() {
+ affectedRegion = new Region();
}
public boolean active;
public Rect rect;
@@ -308,7 +308,7 @@ public class DecodeManager {
return manager.workQueue.peek();
next:for (iter = manager.workQueue.iterator(); iter.hasNext();) {
- QueueEntry entry;
+ QueueEntry entry, entry2;
Iterator<QueueEntry> iter2;
@@ -323,8 +323,9 @@ public class DecodeManager {
// If this is an ordered decoder then make sure this is the first
// rectangle in the queue for that decoder
if ((entry.decoder.flags & DecoderOrdered) != 0) {
- for (iter2 = manager.workQueue.iterator(); iter2.hasNext() && iter2 != iter;) {
- if (entry.encoding == (iter2.next()).encoding) {
+ for (iter2 = manager.workQueue.iterator(); iter2.hasNext() &&
+ !(entry2 = iter2.next()).equals(entry);) {
+ if (entry.encoding == entry2.encoding) {
lockedRegion.assign_union(entry.affectedRegion);
continue next;
}
@@ -334,8 +335,8 @@ public class DecodeManager {
// For a partially ordered decoder we must ask the decoder for each
// pair of rectangles.
if ((entry.decoder.flags & DecoderPartiallyOrdered) != 0) {
- for (iter2 = manager.workQueue.iterator(); iter2.hasNext() && iter2 != iter;) {
- QueueEntry entry2 = iter2.next();
+ for (iter2 = manager.workQueue.iterator(); iter2.hasNext() &&
+ !(entry2 = iter2.next()).equals(entry);) {
if (entry.encoding != entry2.encoding)
continue;
if (entry.decoder.doRectsConflict(entry.rect,