Skip to content

Instantly share code, notes, and snippets.

@fogus
Created January 5, 2022 14:41
Show Gist options
  • Save fogus/3d2fc07fb408d7c6756c9dbcaa5a143a to your computer and use it in GitHub Desktop.
Save fogus/3d2fc07fb408d7c6756c9dbcaa5a143a to your computer and use it in GitHub Desktop.
// v is vector testing equiv
// obj is RHS operand, potentially infinite seq
else if(obj instanceof List)
{
Collection ma = (Collection) obj;
if(ma instanceof Counted)
if(ma.size() != v.count())
return false;
Iterator i2 = ma.iterator();
for(Iterator i1 = ((List) v).iterator(); i1.hasNext();)
{
if(!Util.equiv(i1.next(), i2.next()))
return false;
}
return !i2.hasNext();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment