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

15
LINES

< > BotCompany Repo | #1036049 // concatLongArrays (allows null arrays)

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

Libraryless. Click here for Pure Java version (9220L/51K).

1  
static long[] concatLongArrays(L<long[]> arrays) {
2  
  int l = 0;
3  
  for (long[] a : unnull(arrays)) l += l(a);
4  
  long[] x = new long[l];
5  
  int i = 0;
6  
  for (long[] a : unnull(arrays)) if (a != null) {
7  
    System.arraycopy(a, 0, x, i, l(a));
8  
    i += l(a);
9  
  }
10  
  ret x;
11  
}
12  
13  
static long[] concatLongArrays(long[]... arrays) {
14  
  ret concatLongArrays(asList(arrays));
15  
}

Author comment

Began life as a copy of #1026923

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): mqqgnosmbjvj, wnsclhtenguj

No comments. add comment

Snippet ID: #1036049
Snippet name: concatLongArrays (allows null arrays)
Eternal ID of this version: #1036049/1
Text MD5: 9c14f1883e108e3da5f6eab93fe02ca2
Transpilation MD5: d09781499dc8d79c4f1009ad152d8407
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-09-03 01:51:54
Source code size: 376 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 123 / 170
Referenced in: [show references]