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

8
LINES

< > BotCompany Repo | #1024510 // mapPutOrCreate_multi

JavaX fragment (include)

static <A, B> Map<A, B> mapPutOrCreate_multi(Map<A, B> map, O... keysAndValues) {
  for (int i = 0; i+1 < l(keysAndValues); i += 2) {
    A key = cast keysAndValues[i];
    B value = cast keysAndValues[i+1];
    map = mapPutOrCreate(map, key, value);
  }
  ret map;
}

Author comment

Began life as a copy of #1024478

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1024510
Snippet name: mapPutOrCreate_multi
Eternal ID of this version: #1024510/3
Text MD5: a39f1ffcc115182bcaa038e0eca0dc14
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-15 21:36:38
Source code size: 274 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 191 / 226
Version history: 2 change(s)
Referenced in: [show references]