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

This commit is contained in:
Jon Meow authored and GitHub committed 2021-08-06 10:06:35 -07:00
1 parent f7d8b7f2e2
commit 5749413b28
3 files changed
+8 -4

No files matched your search

@@ -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));