1 | static <A> A[] arraySetWithExponentialGrowth(A[] array, int idx, A element) { |
2 | if (idx >= l(array)) |
3 | array = (A[]) resizeArray(array, max(idx+1, iround(l(array)*1.5))); |
4 | array[idx] = element; |
5 | ret array; |
6 | } |
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: | #1023055 |
Snippet name: | arraySetWithExponentialGrowth |
Eternal ID of this version: | #1023055/4 |
Text MD5: | 949df5f1ea8f60e9be441c0f38075278 |
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:16:31 |
Source code size: | 216 bytes / 6 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 326 / 368 |
Version history: | 3 change(s) |
Referenced in: | [show references] |