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

9
LINES

< > BotCompany Repo | #1005547 - addIfNotNull

JavaX fragment (include)

static <A> bool addIfNotNull(Collection<A> l, A a) {
  ret a != null && l != null & l.add(a);
}

ifclass MultiSet
static <A> void addIfNotNull(MultiSet<A> ms, A a) {
  if (a != null && ms != null) ms.add(a);
}
endif

Author comment

Began life as a copy of #1004244

download  show line numbers  debug dex   

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

No comments. add comment

Snippet ID: #1005547
Snippet name: addIfNotNull
Eternal ID of this version: #1005547/4
Text MD5: f143448aa732024246f5f6b8020387f2
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-06-14 18:26:31
Source code size: 223 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 445 / 450
Version history: 3 change(s)
Referenced in: [show references]

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