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

12
LINES

< > BotCompany Repo | #1031781 // mapToWeakHashMap

JavaX fragment (include) [tags: use-pretranspiled]

Transpiled version (2852L) is out of date.

static <A, B, C> Map<B, C> lambdaMapLike mapToWeakHashMap(IF1<A, Pair<B, C>> f, Iterable<A> l) {
  Map<B, C> map = weakHashMap();
  fOr (A o : l) {
    Pair<B, C> p = callF(f, o);
    mapPut(map, p.a, p.b);
  }
  ret map;
}

static <A, B, C> Map<B, C> lambdaMapLike mapToWeakHashMap(Iterable<A> l, IF1<A, Pair<B, C>> f) {
  ret mapToWeakHashMap(f, l);
}

Author comment

Began life as a copy of #1024294

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1031781
Snippet name: mapToWeakHashMap
Eternal ID of this version: #1031781/3
Text MD5: 6425738dcd41ff45030e39ec37f6df87
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-06-29 18:17:08
Source code size: 360 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 144 / 219
Version history: 2 change(s)
Referenced in: [show references]