Add TupleValue::Empty for the common empty tuple case (#708)

This commit is contained in:
Jon Meow
2021-08-06 10:06:35 -07:00
committed by GitHub
parent f7d8b7f2e2
commit 5749413b28
3 changed files with 8 additions and 4 deletions
@@ -759,8 +759,7 @@ void StepPattern() {
if (act->pos == 0) {
if (tuple.Fields().empty()) {
frame->todo.Pop(1);
frame->todo.Push(Action::MakeValAction(
global_arena->New<TupleValue>(std::vector<TupleElement>())));
frame->todo.Push(Action::MakeValAction(&TupleValue::Empty()));
} else {
const Pattern* p1 = tuple.Fields()[0].pattern;
frame->todo.Push(Action::MakePatternAction(p1));