On Feb 26, 2014, at 2:15 AM, Paul Sandoz wrote: >> I have posted a new webrev taking this approach: >> >> http://cr.openjdk.java.net/~bpb/8035279/webrev.01/ >> >> A review would be appreciated. >>
Thanks for the suggestions … > […] > private int firstNonzeroIntNum() { > int fn = firstNonzeroIntNumPlusTwo - 2; I made all suggested changes except the third line below. Why do we test for equality with -3? If the primitive int default value of zero is used, for firstNonzeroIntNumPlusTwo, as it is, then we should still test whether fn equals -2, n'est-ce pas? > private int firstNonzeroIntNum() { > int fn = firstNonzeroIntNumPlusTwo - 2; > if (fn == -3) { // firstNonzeroIntNum not initialized yet > // Search for the first nonzero int > int i; > int mlen = mag.length; > for (i = mlen - 1; i >= 0 && mag[i] == 0; i--) > ; > fn = mlen - i - 1; > firstNonzeroIntNumPlusTwo = fn + 2; // offset by two to initialize > } > return fn; > } > > An unnecessary assignment is removed from the above method. Yes I noticed that. > -- > > We can revisit and clean things up if/when the JMM is updated. Is there an issue for JMM update to which a comment with a link to this thread could be added? Thanks, Brian