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).

1  
static <A> LPair<IntRange, A> concatenateAdjacentRanges(LPair<IntRange, A> l) {
2  
  new LPair<IntRange, A> out;
3  
  fOr (p : l)
4  
    if (concatenatableIntRanges(pairA(last(out)), p.a) &&
5  
      eq(pairB(last(out)), p.b))
6  
      replaceLast(out, pair(joinIntRanges(pairA(last(out)), p.a), p.b);
7  
    else
8  
      out.add(p);
9  
  ret out;
10  
}

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: 166 / 226
Version history: 1 change(s)
Referenced in: [show references]