Skip to content

Commit

Permalink
compiler; rename getNumArguments to be clearer as to the intent
Browse files Browse the repository at this point in the history
  • Loading branch information
ruby0x1 committed Jul 11, 2020
1 parent 8be40ec commit b3d496e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/vm/wren_compiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -2695,8 +2695,8 @@ void expression(Compiler* compiler)

// Returns the number of arguments to the instruction at [ip] in [fn]'s
// bytecode.
static int getNumArguments(const uint8_t* bytecode, const Value* constants,
int ip)
static int getByteCountForArguments(const uint8_t* bytecode,
const Value* constants, int ip)
{
Code instruction = (Code)bytecode[ip];
switch (instruction)
Expand Down Expand Up @@ -2849,7 +2849,7 @@ static void endLoop(Compiler* compiler)
else
{
// Skip this instruction and its arguments.
i += 1 + getNumArguments(compiler->fn->code.data,
i += 1 + getByteCountForArguments(compiler->fn->code.data,
compiler->fn->constants.data, i);
}
}
Expand Down Expand Up @@ -3566,7 +3566,7 @@ void wrenBindMethodCode(ObjClass* classObj, ObjFn* fn)
// Other instructions are unaffected, so just skip over them.
break;
}
ip += 1 + getNumArguments(fn->code.data, fn->constants.data, ip);
ip += 1 + getByteCountForArguments(fn->code.data, fn->constants.data, ip);
}
}

Expand Down

0 comments on commit b3d496e

Please sign in to comment.