Hello! Just an alternative which looks more readable to me (no explicit bit twiddling): - int ds = listRoots0(); - return IntStream - .range(0, 26) - .filter(i -> ((ds >> i) & 1) != 0) + long[] ds = {listRoots0()}; + return BitSet + .valueOf(ds) + .stream()
Probably a matter of taste though. With best regards, Tagir Valeev. On Wed, Jun 28, 2017 at 2:05 AM, Brian Burkhalter < brian.burkhal...@oracle.com> wrote: > Hi Peter, > > On Jun 24, 2017, at 2:07 PM, Peter Levart <peter.lev...@gmail.com> wrote: > > > This looks good, but since this is not a performance-critical method, > why not use streams? > > > > For example: > > > > […] > > > > > > Isn't this nicer compared to: > > Indeed it is more appealing. Tested successfully and webrev updated > accordingly at http://cr.openjdk.java.net/~bpb/8182710/webrev.01/. > > Thanks, > > Brian