rename expand to inline

This commit is contained in:
2026-08-02 20:31:05 +02:00
parent c92723bc14
commit 9e79d6692b
13 changed files with 123 additions and 82 deletions
+2 -2
View File
@@ -17,7 +17,7 @@ init func(
map EnumMap(E, V) = undefined
match typeinfo!(E) {
.enum |info|: expand for info.fields |field, i| {
.enum |info|: inline for info.fields |field, i| {
map.present[i] = false
if field!(values, field.name) |value| {
@@ -34,7 +34,7 @@ init func(
get func($E, $V type, map @EnumMap(E, V), key E) ?V {
# fixme: linear lookup; implement an enum index/discriminant map for O(1) lookup
match typeinfo!(E) {
.enum |info|: expand for info.fields |field, i| {
.enum |info|: inline for info.fields |field, i| {
if key == field!(E, field.name) {
if (map.present[i]) return map.values[i]
return null