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

6
LINES

< > BotCompany Repo | #1023057 // byteArraySetWithExponentialGrowth

JavaX fragment (include)

static byte[] byteArraySetWithExponentialGrowth(byte[] array, int idx, byte element) {
  if (idx >= l(array))
    array = resizeByteArray(array, max(idx+1, iround(l(array)*1.5)));
  array[idx] = element;
  ret array;
}

Author comment

Began life as a copy of #1023055

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1023057
Snippet name: byteArraySetWithExponentialGrowth
Eternal ID of this version: #1023057/3
Text MD5: 64fb6f8610bd16339704de4ba6017ef8
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-04-29 23:15:35
Source code size: 223 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 307 / 345
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)