aboutsummaryrefslogtreecommitdiff
path: root/src/check_builtin.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-12-20 14:19:55 +0000
committergingerBill <bill@gingerbill.org>2022-12-20 14:19:55 +0000
commit8fc9566a837fbd3fe52f3f1b5e766e122b3c2de2 (patch)
tree8a511e3d57e8f27ed0d98dde37d060eb68437755 /src/check_builtin.cpp
parent134c7db4d21e80751833ed45fb4ace5d0ae3b7d2 (diff)
Use `*_set_update` where possible
Diffstat (limited to 'src/check_builtin.cpp')
-rw-r--r--src/check_builtin.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/check_builtin.cpp b/src/check_builtin.cpp
index 859fbea28..1c13b6b5e 100644
--- a/src/check_builtin.cpp
+++ b/src/check_builtin.cpp
@@ -3126,13 +3126,11 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As
}
- if (string_set_exists(&name_set, name)) {
+ if (string_set_update(&name_set, name)) {
error(op.expr, "Field argument name '%.*s' already exists", LIT(name));
} else {
array_add(&types, arg_type->Slice.elem);
array_add(&names, name);
-
- string_set_add(&name_set, name);
}
}