TaskActionToolbox: Combine adjacent ifs

This commit is contained in:
Gian Merlino 2013-12-19 16:16:34 -08:00
parent f86342f7dc
commit 0ff7f0e8e0
1 changed files with 3 additions and 7 deletions

View File

@ -76,13 +76,9 @@ public class TaskActionToolbox
Preconditions.checkArgument(!segments.isEmpty(), "segments nonempty"); Preconditions.checkArgument(!segments.isEmpty(), "segments nonempty");
final DataSegment firstSegment = segments.iterator().next(); final DataSegment firstSegment = segments.iterator().next();
for (final DataSegment segment : segments) { for (final DataSegment segment : segments) {
if (!segment.getDataSource().equals(firstSegment.getDataSource())) { if (!segment.getDataSource().equals(firstSegment.getDataSource())
return false; || !segment.getInterval().equals(firstSegment.getInterval())
} || !segment.getVersion().equals(firstSegment.getVersion())) {
if (!segment.getInterval().equals(firstSegment.getInterval())) {
return false;
}
if (!segment.getVersion().equals(firstSegment.getVersion())) {
return false; return false;
} }
} }