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

9
LINES

< > TinyBrain | #1018236 - magicSubListsToIntRanges - returns null if not actual sublists

JavaX fragment (include)

static <A> L<IntRange> magicSubListsToIntRanges(L<A> original, LL<A> lists) {
  L<IntRange> out = emptyList(lists);
  for (L l : lists) {
    int i = magicIndexOfSubList(original, l);
    if (i < 0) null;
    out.add(intRange(i, i+l(l)));
  }
  ret out;
}

download  show line numbers  debug dex   

Travelled to 8 computer(s): aoiabmzegqzx, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, tvejysmllsmz

No comments. add comment

Snippet ID: #1018236
Snippet name: magicSubListsToIntRanges - returns null if not actual sublists
Eternal ID of this version: #1018236/2
Text MD5: 8f2581e62558ebe8f605e1426c214810
Author: stefan
Category: javac
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-09-11 17:19:59
Source code size: 263 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 17 / 28
Version history: 1 change(s)
Referenced in: [show]