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

16
LINES

< > BotCompany Repo | #1011482 // Test UTF8 byte array comparator on huge dictionary [OK]

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Libraryless. Click here for Pure Java version (4789L/31K).

!7

p {
  bool ok = true;
  L<S> l = hugeEnglishDictionary();
  for (int i = 0; i < l(l)-1; i++) {
    S a = l.get(i), b = l.get(i+1);
    if (eq(a, b)) continue;
    int x = sign(compareUtf8(toUtf8(a), toUtf8(b)));
    if (x != -1) {
      print("FAIL: " + x + " " + i + " " + a + " vs " + b);
      ok = false;
    }
  }
  if (ok) print("OK!");
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

-
Snippet ID: #1011482
Snippet name: Test UTF8 byte array comparator on huge dictionary [OK]
Eternal ID of this version: #1011482/8
Text MD5: 253fe92d20fb4627b97b497f8d6f07cd
Transpilation MD5: 1c12b8cdb568417f60fe4760eb61e342
Author: stefan
Category: javax
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-10-30 02:26:50
Source code size: 363 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 475 / 1122
Version history: 7 change(s)
Referenced in: