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

11
LINES

< > BotCompany Repo | #1001695 - litmap - skips null values

JavaX fragment (include)

static HashMap litmap(O... x) {
  new HashMap map;
  litmap_impl(map, x);
  ret map;
}

static void litmap_impl(Map map, O... x) {
  if (x != null) for (int i = 0; i < x.length-1; i += 2)
    if (x[i+1] != null)
      map.put(x[i], x[i+1]);
}

download  show line numbers  debug dex   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, whxojlpjdney

No comments. add comment

Snippet ID: #1001695
Snippet name: litmap - skips null values
Eternal ID of this version: #1001695/5
Text MD5: eaf66cbfae3fbc408d2bc72fff994f84
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-07-19 16:34:15
Source code size: 252 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 529 / 2371
Version history: 4 change(s)
Referenced in: #1002427 #1004550 #1006654 #1021054 #1023181 #1024486 #1028609 #3000382 #3000383

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