Skip to content

Commit ba2a29a

Browse files
authored
minor performance improvement (#2532)
1 parent 8530366 commit ba2a29a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/main/java/graphql/execution/ConditionalNodes.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ public class ConditionalNodes {
2020

2121
public boolean shouldInclude(Map<String, Object> variables, List<Directive> directives) {
2222
boolean skip = getDirectiveResult(variables, directives, SkipDirective.getName(), false);
23-
boolean include = getDirectiveResult(variables, directives, IncludeDirective.getName(), true);
24-
return !skip && include;
23+
if (skip) {
24+
return false;
25+
}
26+
27+
return getDirectiveResult(variables, directives, IncludeDirective.getName(), true);
2528
}
2629

2730
private boolean getDirectiveResult(Map<String, Object> variables, List<Directive> directives, String directiveName, boolean defaultValue) {

0 commit comments

Comments
 (0)