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

5
LINES

< > BotCompany Repo | #1023183 // exhaustIterator - step through whole iterator and discard items

JavaX fragment (include)

static <A> long exhaustIterator(Iterator<A> it) {
  long n = 0;
  if (it != null) while ping (it.hasNext()) { ++n; it.next(); }
  ret n;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1023183
Snippet name: exhaustIterator - step through whole iterator and discard items
Eternal ID of this version: #1023183/3
Text MD5: b1d1ff0d9ea561892d88d2117cf88a17
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-02-26 12:45:48
Source code size: 142 bytes / 5 lines
Pitched / IR pitched: No / No
Views / Downloads: 255 / 265
Version history: 2 change(s)
Referenced in: [show references]