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

10
LINES

< > BotCompany Repo | #1030192 // allElementsEqual

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

Libraryless. Click here for Pure Java version (2528L/16K).

1  
static <A> bool allElementsEqual(Iterable<A> l) {
2  
  if (l == null) true;
3  
  Iterator<A> it = iterator(l);
4  
  if (!it.hasNext()) true;
5  
  A a = it.next();
6  
  while ping (it.hasNext()) {
7  
    if (!eq(a, it.next())) false;
8  
  }
9  
  true;
10  
}

Author comment

Began life as a copy of #1008440

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030192
Snippet name: allElementsEqual
Eternal ID of this version: #1030192/1
Text MD5: 8d4e5519b8723c0684e755e73ee8133b
Transpilation MD5: d00417792ab37cf235f85d9ad56c2c86
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-11-14 12:01:29
Source code size: 237 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 202 / 277
Referenced in: [show references]