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

10
LINES

< > BotCompany Repo | #1033293 // concatenateAdjacentRanges

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

Libraryless. Click here for Pure Java version (4077L/23K).

static <A> LPair<IntRange, A> concatenateAdjacentRanges(LPair<IntRange, A> l) {
  new LPair<IntRange, A> out;
  fOr (p : l)
    if (concatenatableIntRanges(pairA(last(out)), p.a) &&
      eq(pairB(last(out)), p.b))
      replaceLast(out, pair(joinIntRanges(pairA(last(out)), p.a), p.b);
    else
      out.add(p);
  ret out;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1033293
Snippet name: concatenateAdjacentRanges
Eternal ID of this version: #1033293/2
Text MD5: e87aa7e4de8877edca933f392d4a7cf3
Transpilation MD5: 5e6d70d59cdece15a1026f960fac3ec4
Author: stefan
Category: javax / audio analysis
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-18 11:55:00
Source code size: 335 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 167 / 228
Version history: 1 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1033295 - concatenateAdjacentDoubleRanges