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

15
LINES

< > BotCompany Repo | #1012620 // strictPutIC - mapPutStrictly with ignore-case - return true if value can be put strictly (not overwriting anything)

JavaX fragment (include)

1  
static <A> bool strictPutIC(Map<A, S> map, A key, S value) {
2  
  if (!(map != null && key != null && value != null)) true;
3  
  S old = map.get(key);
4  
  if (old == null) { map.put(key, value); true; }
5  
  ret eqic(old, value);
6  
}
7  
8  
ifclass Symbol
9  
static bool strictPutIC(SymbolSymbol map, Symbol key, Symbol value) {
10  
  if (!(map != null && key != null && value != null)) true;
11  
  Symbol old = map.get(key);
12  
  if (old == null) { map.put(key, value); true; }
13  
  ret eqic(old, value);
14  
}
15  
endif

Author comment

Began life as a copy of #1012146

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1012620
Snippet name: strictPutIC - mapPutStrictly with ignore-case - return true if value can be put strictly (not overwriting anything)
Eternal ID of this version: #1012620/6
Text MD5: 61ec5cd04e1fd4118e401d5924d3d67f
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-08-15 15:58:14
Source code size: 491 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 362 / 425
Version history: 5 change(s)
Referenced in: [show references]