Skip to content

Commit 1c4225b

Browse files
lukewhitingszybia
andauthored
Apply suggestion from @szybia
Co-authored-by: Szymon Bialkowski <[email protected]>
1 parent 5faf7fb commit 1c4225b

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

server/src/main/java/org/elasticsearch/action/bulk/BulkResponse.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,12 @@ public Iterator<? extends ToXContent> toXContentChunked(ToXContent.Params params
171171

172172
@Override
173173
public boolean equals(Object o) {
174-
if (o instanceof BulkResponse that) {
175-
return tookInMillis == that.tookInMillis
176-
&& ingestTookInMillis == that.ingestTookInMillis
177-
&& Arrays.equals(responses, that.responses)
178-
&& Objects.equals(incrementalState, that.incrementalState);
179-
} else {
180-
return false;
181-
}
174+
return o == this || (o instanceof BulkResponse that
175+
&& tookInMillis == that.tookInMillis
176+
&& ingestTookInMillis == that.ingestTookInMillis
177+
&& Arrays.equals(responses, that.responses)
178+
&& Objects.equals(incrementalState, that.incrementalState));
179+
}
182180
}
183181

184182
@Override

0 commit comments

Comments
 (0)