RFR(S): 8007986: GrowableArray should implement binary search (original) (raw)

Roland Westrelin roland.westrelin at oracle.com
Wed Apr 15 10:25:52 UTC 2015


Hi Vitaly,

Just a couple of notes in passing.

1) may be worthwhile to compute mid in a way that avoids possible signed overflow? I'm guessing this class is not used with sizes that large, but just a precaution. 2) perhaps store the result of calling f() in a local to avoid calling it twice?

Thanks for the suggestions. Here is a new webrev that take them into account:

http://cr.openjdk.java.net/~roland/8007986/webrev.01/

Roland.

$.02 sent from my phone On Mar 26, 2015 9:34 AM, "Roland Westrelin" <roland.westrelin at oracle.com> wrote: http://cr.openjdk.java.net/~roland/8007986/webrev.00/ The same binary search code on GrowableArray is used in 3 places (in the compilers). This moves that code in GrowableArray. Roland.



More information about the hotspot-dev mailing list