Programming-Idioms

History of Idiom 247

Idiom #247 Filter list in-place

Remove all the elements from list x that don't satisfy the predicate p, without allocating a new list.
Keep all the elements that do satisfy p.

For languages that don't have mutable lists, refer to idiom #57 instead.

#Edit dateEdit SummaryAuthor
👁 Δ 16 2021-02-21, 12:56 New Rust implementation by user [Zs] Zs
👁 Δ 15 2021-01-23, 23:43 New JS implementation by user [Vaporox] Vaporox
👁 Δ 14 2021-01-07, 09:49 [Ruby] +DocURL programming-idioms.org
👁 Δ 13 2021-01-07, 09:33 Linked to idiom #254 [Replace value in list] programming-idioms.org
👁 Δ 12 2021-01-06, 01:26 New Ruby implementation by user [steenslag] steenslag
👁 Δ 12 2021-01-06, 01:26 New Ruby implementation by user [steenslag] steenslag
👁 Δ 11 2020-12-27, 19:06 [C++] Add to comments WHS
👁 Δ 10 2020-12-27, 19:04 New C++ implementation by user [WHS] WHS
👁 Δ 9 2020-12-27, 19:00 New C++ implementation by user [WHS] WHS
👁 Δ 8 2020-12-09, 17:07 New Pascal implementation by user [Bart] Bart
👁 Δ 7 2020-12-09, 12:13 Extra explicit statement: Keep all the elements that do satisfy p. programming-idioms.org
👁 Δ 6 2020-12-09, 12:11 Linked to idiom #136 [ Remove all occurrences of a value from a list] programming-idioms.org
👁 Δ 5 2020-12-09, 12:07 New Go implementation by user [programming-idioms.org] programming-idioms.org
👁 Δ 4 2020-12-09, 11:56 [Go] +DemoURL programming-idioms.org
👁 Δ 3 2020-12-09, 11:55 +Related URL Idiom #57: Filter list programming-idioms.org
👁 Δ 2 2020-12-09, 11:53 Linked to idiom #57 [Filter list] programming-idioms.org
1 2020-12-09, 11:53 Idiom creation by user [programming-idioms.org] programming-idioms.org