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

11
LINES

< > BotCompany Repo | #1029322 - compareCharIterators_maxLen

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (41L/1K).

static int compareCharIterators_maxLen(CharacterIterator it1, CharacterIterator it2, int n) {
  for i to n: {
    if (!it1.hasNext())
      ret it2.hasNext() ? -1 : 0;
    if (!it2.hasNext()) ret 1;
    char a = it1.next(), b = it2.next();
    if (a < b) ret -1;
    if (a > b) ret 1;
  }
  ret 0;
}

Author comment

Began life as a copy of #1029161

download  show line numbers  debug dex   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pzhvpgtvlbxg, xrpafgyirdlv

No comments. add comment

Snippet ID: #1029322
Snippet name: compareCharIterators_maxLen
Eternal ID of this version: #1029322/1
Text MD5: d512132676ae6d964d98c5090d2cdffa
Transpilation MD5: 24d4ed5cc3982bb058518fedef8bbcb8
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-30 21:54:17
Source code size: 309 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 4 / 15
Referenced in: [show references]

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