From b3d496ea36757696c7eecedccea01e99e26e35a4 Mon Sep 17 00:00:00 2001 From: underscorediscovery Date: Fri, 10 Jul 2020 19:13:44 -0700 Subject: [PATCH] compiler; rename getNumArguments to be clearer as to the intent --- src/vm/wren_compiler.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vm/wren_compiler.c b/src/vm/wren_compiler.c index 86f2c03c..b8961f7f 100644 --- a/src/vm/wren_compiler.c +++ b/src/vm/wren_compiler.c @@ -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) @@ -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); } } @@ -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); } }