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

8
LINES

< > BotCompany Repo | #1019374 // reverseParams - reverse a params list (object list of key-value pairs)

JavaX fragment (include)

1  
static O[] reverseParams(O[] params) {
2  
  int n = l(params);
3  
  if (params == null || odd(n)) ret params;
4  
  O[] a = new O[n];
5  
  for (int i = 0; i+1 < n; i += 2)
6  
    arraycopy(params, i, a, n-i-2, 2);
7  
  ret a;
8  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 12 computer(s): bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1019374
Snippet name: reverseParams - reverse a params list (object list of key-value pairs)
Eternal ID of this version: #1019374/2
Text MD5: 93f5a7579cf85a51f7211ff408a76b06
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-11-04 17:24:51
Source code size: 215 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 335 / 367
Version history: 1 change(s)
Referenced in: [show references]