Libraryless. Click here for Pure Java version (9252L/51K).
1 | static IntRange addToIntRange(IntRange r, int val) { |
2 | if (r == null || r.empty()) |
3 | ret new IntRange(val, val+1); |
4 | if (val < r.start) ret intRange(val, r.end); |
5 | if (val >= r.end) ret intRange(r.start, val+1); |
6 | ret r; |
7 | } |
Began life as a copy of #1005874
download show line numbers debug dex old transpilations
Travelled to 2 computer(s): mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1035502 |
Snippet name: | addToIntRange |
Eternal ID of this version: | #1035502/3 |
Text MD5: | 61e1d3195d78a8addc483c5fcbfc80cf |
Transpilation MD5: | a32b404b031ca6d4029913a511e5cff8 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-05-30 18:02:24 |
Source code size: | 230 bytes / 7 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 123 / 184 |
Version history: | 2 change(s) |
Referenced in: | [show references] |