java - Short circuit logical operators over Iterable -


consider following code, loop can finish hits false value. there better way checking false after each iteration?

boolean result = true; list<boolean> blist = new arraylist<>(); (boolean b : blist) {     result = result && b;     if (!result) {         break;     } } 

what about

if (blist.contains(false)) {   ... 

Comments

Popular posts from this blog

cron - how to properly run Python script with crontab on every system startup -

elasticsearch - Is the order of operations guaranteed in a bulk update? -

Slow performance first queries on SQL Azure -