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

10
LINES

< > BotCompany Repo | #1003252 - mapWithoutKey - clone map (if necessary), drop a key

JavaX fragment (include)

static <A, B> Map<A, B> mapWithoutKey(Map<A, B> map, A key) {
  if (map == null || !map.containsKey(key)) ret map;
  Map m = cloneMap(map);
  m.remove(key);
  ret m;
}

static <A, B> Map<A, B> mapWithoutKey(A key, Map<A, B> map) {
  ret mapWithoutKey(map, key);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz

No comments. add comment

Snippet ID: #1003252
Snippet name: mapWithoutKey - clone map (if necessary), drop a key
Eternal ID of this version: #1003252/5
Text MD5: 7f05910a96055ab0bcf394bccb35c4de
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-10-26 09:30:57
Source code size: 268 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 442 / 400
Version history: 4 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1003252 & http://1003252.tinybrain.de