Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

12
LINES

< > BotCompany Repo | #1033591 // filterCollectionInPlace

JavaX fragment (include) [tags: use-pretranspiled]

Transpiled version (4558L) is out of date.

static <A> Cl<A> lambdaMapLike filterCollectionInPlace(IPred<A> pred, Cl<A> l) {
  if (l == null) ret l;
  var it = l.iterator();
  while (it.hasNext())
    if (!pred.get(it.next()))
      it.remove();
  ret l;
}

static <A> Cl<A> lambdaMapLike filterCollectionInPlace(Cl<A> l, IPred<A> pred) {
  ret filterCollectionInPlace(pred, l);
}

Author comment

Began life as a copy of #1019151

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1033591
Snippet name: filterCollectionInPlace
Eternal ID of this version: #1033591/4
Text MD5: c2668c881560cd794cf976764015e35c
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-11-04 04:19:55
Source code size: 343 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 80 / 124
Version history: 3 change(s)
Referenced in: [show references]