digitalmars.D.bugs - [Issue 13565] New: add AA batch remove using a predicate function
- via Digitalmars-d-bugs (29/29) Oct 01 2014 https://issues.dlang.org/show_bug.cgi?id=13565
https://issues.dlang.org/show_bug.cgi?id=13565 Issue ID: 13565 Summary: add AA batch remove using a predicate function Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P2 Component: druntime Assignee: nobody puremagic.com Reporter: code dawg.eu To remove multiple AA entries at once we should support calling aa.remove with a predicate function, taking key and value. Old code: Louter: while (true) { Key key; foreach (k, v; aa) { if (!pred(k, v)) continue; aa.remove(k); continue Louter; } break; } New code: aa.remove((k, v) => pred(k, v)); --
Oct 01 2014