Skip to content

Commit

Permalink
fix(query_runner): make setup function run unconditionally
Browse files Browse the repository at this point in the history
  • Loading branch information
xcb-xwii committed Apr 16, 2024
1 parent f55062e commit a852f26
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion ldoc/Query/Runner.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
--
-- The `setup` function is ran before executing the predicates of a `Match` or
-- `Capture`. This may be useful to ensure side-effects of skipped items are
-- erased. It is not ran if there are no predicates.
-- erased.
-- @tparam {string:function(...)} predicates
-- @tparam ?function() setup
-- @treturn Runner
Expand Down
1 change: 0 additions & 1 deletion src/query/runner.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ static bool run_predicates(
match.pattern_index,
&count
);
if (count == 0) return true;

lua_pushvalue(L, setup_idx);
if (lua_isnil(L, -1)) {
Expand Down

0 comments on commit a852f26

Please sign in to comment.