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

9
LINES

< > BotCompany Repo | #1011481 // compareUtf8

JavaX fragment (include)

static int compareUtf8(byte[] left, byte[] right) {
  int n = min(left.length, right.length);
  for (int i = 0; i < n; i++) {
    int a = left[i] & 0xff;
    int b = right[i] & 0xff;
    if (a != b) ret a-b;
  }
  ret left.length - right.length;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1011481
Snippet name: compareUtf8
Eternal ID of this version: #1011481/1
Text MD5: 1aaaaa141e34c2a9fee277bd2af99a49
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-10-30 02:17:21
Source code size: 255 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 388 / 418
Referenced in: [show references]