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

static long[] concatLongArrays(L<long[]> arrays) {
  int l = 0;
  for (long[] a : unnull(arrays)) l += l(a);
  long[] x = new long[l];
  int i = 0;
  for (long[] a : unnull(arrays)) if (a != null) {
    System.arraycopy(a, 0, x, i, l(a));
    i += l(a);
  }
  ret x;
}

static long[] concatLongArrays(long[]... arrays) {
  ret concatLongArrays(asList(arrays));
}

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: 50 / 69
Referenced in: [show references]