Skip to content

Commit

Permalink
Make 1 return statement with ternary
Browse files Browse the repository at this point in the history
  • Loading branch information
rickie committed Feb 15, 2021
1 parent 68b5fca commit b2d642c
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@ public final class TimeZoneUsageCheck extends BugChecker implements MethodInvoca

@Override
public Description matchMethodInvocation(MethodInvocationTree tree, VisitorState state) {
if (!IS_BANNED_TIME_METHOD.matches(tree, state)) {
return Description.NO_MATCH;
}
return buildDescription(tree).build();
return IS_BANNED_TIME_METHOD.matches(tree, state)
? buildDescription(tree).build()
: Description.NO_MATCH;
}
}

0 comments on commit b2d642c

Please sign in to comment.