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

14
LINES

< > BotCompany Repo | #1030250 // syncRemoveAllExcept

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

Libraryless. Click here for Pure Java version (2598L/16K).

// syncs on a
static <A> bool syncRemoveAllExcept(Set<A> a, Collection<A> b) {
  if (a == null) false;
  synchronized(collectionMutex(a)) {
    ret removeAllBut(a, b);
  }
}

static <A, B> bool syncRemoveAllExcept(Map<A, B> a, Collection<A> b) {
  if (a == null) false;
  synchronized(collectionMutex(a)) {
    ret removeAllBut(a, b);
  }
}

Author comment

Began life as a copy of #1030249

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030250
Snippet name: syncRemoveAllExcept
Eternal ID of this version: #1030250/1
Text MD5: fe802b402bfe1f616965de0be0ca773a
Transpilation MD5: c6846aa1760e5bd8a3b49c485f1d7f24
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-11-20 16:47:28
Source code size: 353 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 105 / 162
Referenced in: [show references]