Skip to content

Commit

Permalink
Remove unnecessary context_evaluate call when executing OP_FIND_VAR
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanahsmith committed Sep 30, 2020
1 parent 4d108a8 commit 5cee268
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ext/liquid_c/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ID id_aset, id_set_context;
static ID id_has_key, id_aref;
static ID id_ivar_scopes, id_ivar_environments, id_ivar_static_environments, id_ivar_strict_variables;

VALUE context_evaluate(VALUE self, VALUE expression)
static VALUE context_evaluate(VALUE self, VALUE expression)
{
// Scalar type stored directly in the VALUE, this needs to be checked anyways to use RB_BUILTIN_TYPE
if (RB_SPECIAL_CONST_P(expression))
Expand Down
1 change: 0 additions & 1 deletion ext/liquid_c/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define LIQUID_CONTEXT_H

void init_liquid_context();
VALUE context_evaluate(VALUE self, VALUE expression);
VALUE context_find_variable(VALUE self, VALUE key, VALUE raise_on_not_found);
void context_maybe_raise_undefined_variable(VALUE self, VALUE key);

Expand Down
2 changes: 1 addition & 1 deletion ext/liquid_c/vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ static VALUE vm_render_until_error(VALUE uncast_args)
{
VALUE key = vm_stack_pop(vm);
VALUE value = context_find_variable(args->context, key, Qtrue);
vm_stack_push(vm, context_evaluate(args->context, value));
vm_stack_push(vm, value);
break;
}
case OP_LOOKUP_CONST_KEY:
Expand Down

0 comments on commit 5cee268

Please sign in to comment.