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

17
LINES

< > BotCompany Repo | #1008440 // allEq

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

Libraryless. Click here for Pure Java version (5016L/28K).

static bool allEq(O... l) {
  if (empty(l)) true;
  int n = l(l);
  O o = l[0];
  for (int i = 1; i < n; i++)
    if (neq(l[i], o)) false;
  true;
}

static <A> bool allEq(Iterable<A> l) {
  var it = iterator(l);
  if (!it.hasNext()) true;
  A o = it.next();
  while (it.hasNext())
    if (neq(it.next(), o)) false;
  true;
}

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: #1008440
Snippet name: allEq
Eternal ID of this version: #1008440/4
Text MD5: 7980436d7d87c8175f2f7ef37f19e361
Transpilation MD5: f83028751ad8235e7dc86b983ce4e953
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-02-11 21:06:09
Source code size: 341 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 502 / 545
Version history: 3 change(s)
Referenced in: [show references]