summaryrefslogtreecommitdiffstats
path: root/document
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2018-09-10 11:00:17 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2018-09-10 11:00:17 +0200
commitaf0574fa2162488f8aaa9aaf359b53fd0a312ab3 (patch)
treebd410a546283c4a3e4b1f6b9a208b84574f0e4ce /document
parent440a39081e32ad634eb27ebfa5eb31b84f9c39e6 (diff)
Use the cheaper equals instead of potentially expensive compareTo.
Diffstat (limited to 'document')
-rw-r--r--document/src/main/java/com/yahoo/document/DocumentUpdate.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/document/src/main/java/com/yahoo/document/DocumentUpdate.java b/document/src/main/java/com/yahoo/document/DocumentUpdate.java
index 70c5410534e..3374714e3a7 100644
--- a/document/src/main/java/com/yahoo/document/DocumentUpdate.java
+++ b/document/src/main/java/com/yahoo/document/DocumentUpdate.java
@@ -137,7 +137,7 @@ public class DocumentUpdate extends DocumentOperation implements Iterable<FieldP
ValueUpdate last = update.getValueUpdate(update.size() - 1);
if (last instanceof AssignValueUpdate) {
FieldValue currentValue = doc.getFieldValue(update.getField());
- if ((currentValue != null) && (currentValue.compareTo(last.getValue()) == 0)) {
+ if ((currentValue != null) && currentValue.equals(last.getValue())) {
iter.remove();
}
}