refactor: improve arity-metadata readability per review feedback

Agent-Logs-Url: https://github.com/abhigyanpatwari/GitNexus/sessions/ddcbc075-2999-492c-a0ac-47cddd401a4b

Co-authored-by: magyargergo <11230420+magyargergo@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-05-10 16:17:18 +00:00 committed by GitHub
parent 14c4639c36
commit 7eec92fe13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -29,7 +29,8 @@ export function computeCDeclarationArity(node: SyntaxNode): CArityInfo {
// (void) means zero parameters
if (params.length === 1 && params[0].type === 'parameter_declaration') {
const typeNode = params[0].childForFieldName?.('type');
if (typeNode !== null && typeNode !== undefined && typeNode.text === 'void' && params[0].childForFieldName?.('declarator') === null) {
const hasDeclarator = params[0].childForFieldName?.('declarator') !== null;
if (typeNode != null && typeNode.text === 'void' && !hasDeclarator) {
return { parameterCount: 0, requiredParameterCount: 0, parameterTypes: [] };
}
}