This commit is contained in:
gingerBill
2021-04-12 17:13:05 +01:00
parent 4fb4ada2c7
commit 2b36069924

View File

@@ -281,7 +281,7 @@ reduce :: proc(s: $S/[]$U, initializer: $V, f: proc(V, U) -> V) -> V {
}
filter :: proc(s: $S/[]$U, f: proc(U) -> bool, allocator := context.allocator) -> S {
r := make([dynamic]S, 0, 0, allocator);
r := make([dynamic]U, 0, 0, allocator);
for v in s {
if f(v) {
append(&r, v);