classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patch: remove redundant loop in StringBuffer


From: Tom Tromey
Subject: Re: Patch: remove redundant loop in StringBuffer
Date: 24 Feb 2004 09:17:54 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

>>>>> "Anthony" == Anthony Green <address@hidden> writes:

Anthony> 2004-02-24  Anthony Green  <address@hidden>
Anthony> * java/lang/StringBuffer.java: No need to NULL out remainder of
Anthony> buffer since ensureCapacity_unsynchronized will have done this for
Anthony> us.

I think the loop is still needed for the case where you resize the
StringBuffer but the underlying array is not resized.  For instance,
you might fill in the buffer, shrink it, then regrow it.  In this
case, don't we need the newly visible slots to be \0 instead of
whatever appeared in them earlier?

It is an unusual situation though.  We could test for it and only zero
parts in the case where it is needed.

Tom




reply via email to

[Prev in Thread] Current Thread [Next in Thread]