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

9
LINES

< > BotCompany Repo | #1036493 // joinTimestampRanges

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

Libraryless. Click here for Pure Java version (10056L/55K).

static TimestampRange joinTimestampRanges(TimestampRange a, TimestampRange b) {
  if (a == null) ret b;
  if (b == null) ret a;
  ret TimestampRange(min(a.start, b.start), max(a.end, b.end));
}

static TimestampRange joinTimestampRanges(Iterable<TimestampRange> l) {
  ret fold joinTimestampRanges(l);
}

Author comment

Began life as a copy of #1033296

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1036493
Snippet name: joinTimestampRanges
Eternal ID of this version: #1036493/6
Text MD5: d808500d3bd618835cb49e380687edb3
Transpilation MD5: fd6dada4e06cbb2acc57b3093f947dcc
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-12-20 22:14:36
Source code size: 311 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 73 / 122
Version history: 5 change(s)
Referenced in: [show references]