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

10
LINES

< > BotCompany Repo | #1033295 // concatenateAdjacentDoubleRanges

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

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

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

Author comment

Began life as a copy of #1033293

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1033295
Snippet name: concatenateAdjacentDoubleRanges
Eternal ID of this version: #1033295/3
Text MD5: 105467b506a80f6b69543b2d959e3bd2
Transpilation MD5: 767192fcabfcc240c65c7398b9242bcd
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 12:00:02
Source code size: 350 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 149 / 225
Version history: 2 change(s)
Referenced in: [show references]