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

6
LINES

< > BotCompany Repo | #1035624 // resizeShortArray

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

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

1  
static short[] resizeShortArray(short[] a, int n) {
2  
  if (n == lShortArray(a)) ret a;
3  
  short[] b = new[n];
4  
  arraycopy(a, 0, b, 0, Math.min(lShortArray(a), n));
5  
  ret b;
6  
}

Author comment

Began life as a copy of #1029188

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): elmgxqgtpvxh, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035624
Snippet name: resizeShortArray
Eternal ID of this version: #1035624/1
Text MD5: fb6d3435a5d60e6abcb52693ce2cffd8
Transpilation MD5: 284facf298fc5eccba144162e49aad57
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-06-26 23:09:37
Source code size: 177 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 127 / 171
Referenced in: [show references]