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

11
LINES

< > BotCompany Repo | #1016682 // concatShortArrays (allows null arrays)

JavaX fragment (include)

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

Author comment

Began life as a copy of #1003113

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1016682
Snippet name: concatShortArrays (allows null arrays)
Eternal ID of this version: #1016682/4
Text MD5: 94f6f68f4f5345ab5df41f57d1750dc5
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-06-28 00:18:33
Source code size: 287 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 328 / 360
Version history: 3 change(s)
Referenced in: [show references]