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

16
LINES

< > BotCompany Repo | #1029362 // intArrayToBoxed

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

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

1  
static Int[] intArrayToBoxed(int[] l) {
2  
  if (l == null) null;
3  
  int n = l.length;
4  
  Int[] a = new[n];
5  
  for i to n:
6  
    a[i] = l[i];
7  
  ret a;
8  
}
9  
10  
static Int[] intArrayToBoxed(int[] l, int from, int to) {
11  
  if (l == null) null;
12  
  Int[] a = new[to-from];
13  
  for (int i = from; i < to; i++)
14  
    a[i-from] = l[i];
15  
  ret a;
16  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1029362
Snippet name: intArrayToBoxed
Eternal ID of this version: #1029362/2
Text MD5: 7648ab304c7855cefdf4a6ea5f7d6abc
Transpilation MD5: 39ed0da9cd4a69c0c3ffbfe199bb3dfc
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-08-02 16:23:07
Source code size: 334 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 99 / 158
Version history: 1 change(s)
Referenced in: [show references]