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

12
LINES

< > BotCompany Repo | #1019283 // lhm_replaceFirstKey

JavaX fragment (include)

static <A, B> LinkedHashMap<A, B> lhm_replaceFirstKey(Map<A, B> map, A newKey) {
  new LinkedHashMap<A, B> out;
  bool first = true;
  for (A a, B b : unnull(map)) {
    if (first) {
      out.put(newKey, b);
      first = false;
    } else
      out.put(a, b);
  }
  ret out;
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1019283
Snippet name: lhm_replaceFirstKey
Eternal ID of this version: #1019283/2
Text MD5: b45d02bd5706d92995c5e8b3244dd525
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-10-29 12:18:54
Source code size: 289 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 302 / 337
Version history: 1 change(s)
Referenced in: [show references]