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)

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

download  show line numbers  debug dex   

Travelled to 8 computer(s): cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, tvejysmllsmz

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: 110 / 121
Version history: 1 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1019374 & http://1019374.tinybrain.de