Skip to content

Commit

Permalink
Merge if statement with the enclosing one
Browse files Browse the repository at this point in the history
  • Loading branch information
SachinAkash01 committed Feb 19, 2025
1 parent 04fb859 commit 5b9597c
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,9 @@ private boolean isInsidePublicFunction(Node node) {
private boolean isDerivedFromParameter(Node node) {
Node parent = node.parent();
while (parent != null) {
if (parent instanceof FunctionDefinitionNode functionNode) {
if (isInsidePublicFunction(functionNode)) {
return functionNode.functionSignature().parameters().stream()
.anyMatch(param -> param.toSourceCode().equals(node.toSourceCode()));
}
if (parent instanceof FunctionDefinitionNode functionNode && isInsidePublicFunction(functionNode)) {
return functionNode.functionSignature().parameters().stream()
.anyMatch(param -> param.toSourceCode().equals(node.toSourceCode()));
}
parent = parent.parent();
}
Expand Down

0 comments on commit 5b9597c

Please sign in to comment.