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

8
LINES

< > BotCompany Repo | #1006736 // resizeArray

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

Transpiled version (182L) is out of date.

1  
meta-for O also as double, float, long {
2  
  static O[] resizeArray(O[] a, int n) {
3  
    if (n == l(a)) ret a;
4  
    O[] b = new[n];
5  
    arraycopy(a, 0, b, 0, min(l(a), n));
6  
    ret b;
7  
  }
8  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1006736
Snippet name: resizeArray
Eternal ID of this version: #1006736/4
Text MD5: 306c9a0217a4987ad36d24930828ca0d
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-10-03 19:29:57
Source code size: 192 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 573 / 642
Version history: 3 change(s)
Referenced in: [show references]