From 0ff7f0e8e025ea92d954214ff7077b1f259703c4 Mon Sep 17 00:00:00 2001 From: Gian Merlino Date: Thu, 19 Dec 2013 16:16:34 -0800 Subject: [PATCH] TaskActionToolbox: Combine adjacent ifs --- .../indexing/common/actions/TaskActionToolbox.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/indexing-service/src/main/java/io/druid/indexing/common/actions/TaskActionToolbox.java b/indexing-service/src/main/java/io/druid/indexing/common/actions/TaskActionToolbox.java index 10c4d627462..d9b0520f40b 100644 --- a/indexing-service/src/main/java/io/druid/indexing/common/actions/TaskActionToolbox.java +++ b/indexing-service/src/main/java/io/druid/indexing/common/actions/TaskActionToolbox.java @@ -76,13 +76,9 @@ public class TaskActionToolbox Preconditions.checkArgument(!segments.isEmpty(), "segments nonempty"); final DataSegment firstSegment = segments.iterator().next(); for (final DataSegment segment : segments) { - if (!segment.getDataSource().equals(firstSegment.getDataSource())) { - return false; - } - if (!segment.getInterval().equals(firstSegment.getInterval())) { - return false; - } - if (!segment.getVersion().equals(firstSegment.getVersion())) { + if (!segment.getDataSource().equals(firstSegment.getDataSource()) + || !segment.getInterval().equals(firstSegment.getInterval()) + || !segment.getVersion().equals(firstSegment.getVersion())) { return false; } }