On 03/03/2014 16:31, Gary Gregory wrote: > It reads better to me. > > Gary > > -------- Original message -------- > From: Simone Tripodi <simonetrip...@apache.org> > Date:03/03/2014 10:40 (GMT-05:00) > To: Commons Developers List <dev@commons.apache.org> > Subject: Re: svn commit: r1573561 - > /commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/DelegatingConnection.java > > > Hi there, > just a matter of curiosity: would > > + if(traces != null && !traces.isEmpty() { > > be better or not compared to > > + if(traces != null && traces.size() > 0) { > > That should be the same, right?
My only concern at this point is performance and that size() call is way below the noise level at this point. I have no objection if folks want to paint that bike shed a different colour as long as it has no measurable, negative impact on performance. Mark > TIA all the best > -Simo > > http://people.apache.org/~simonetripodi/ > http://twitter.com/simonetripodi > > > On Mon, Mar 3, 2014 at 2:43 PM, <ma...@apache.org> wrote: > >> Author: markt >> Date: Mon Mar 3 13:43:28 2014 >> New Revision: 1573561 >> >> URL: http://svn.apache.org/r1573561 >> Log: >> Another small performance tweak. >> >> Modified: >> >> commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/DelegatingConnection.java >> >> Modified: >> commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/DelegatingConnection.java >> URL: >> http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/DelegatingConnection.java?rev=1573561&r1=1573560&r2=1573561&view=diff >> >> ============================================================================== >> --- >> commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/DelegatingConnection.java >> (original) >> +++ >> commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/DelegatingConnection.java >> Mon Mar 3 13:43:28 2014 >> @@ -623,7 +623,7 @@ public class DelegatingConnection<C exte >> // Statement's when it is closed. >> // DBCP-288. Not all the traced objects will be statements >> List<AbandonedTrace> traces = getTrace(); >> - if(traces != null) { >> + if(traces != null && traces.size() > 0) { >> Iterator<AbandonedTrace> traceIter = traces.iterator(); >> while (traceIter.hasNext()) { >> Object trace = traceIter.next(); >> >> >> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org