diff options
author | Frank Schönheit <fs@openoffice.org> | 2002-10-04 07:33:18 +0000 |
---|---|---|
committer | Frank Schönheit <fs@openoffice.org> | 2002-10-04 07:33:18 +0000 |
commit | 73cc70273b0ec3119b558ebce6370a57730c15fd (patch) | |
tree | d5ca3c329080be544a453dafd91e684b62ef4128 /cppuhelper | |
parent | 3ed849358bbc4beacb456e3f903b52709d58b1bb (diff) |
#103388# (done by fs, approved by jbu) realloc: don't realloc/copy the sequence (elements) ourself, rely on the Sequence's realloc method (which is more performant for a large number of consecutive addListener calls)
Diffstat (limited to 'cppuhelper')
-rw-r--r-- | cppuhelper/source/interfacecontainer.cxx | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/cppuhelper/source/interfacecontainer.cxx b/cppuhelper/source/interfacecontainer.cxx index 6192480d4..8bad8455a 100644 --- a/cppuhelper/source/interfacecontainer.cxx +++ b/cppuhelper/source/interfacecontainer.cxx @@ -2,9 +2,9 @@ * * $RCSfile: interfacecontainer.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: dbo $ $Date: 2001-12-14 13:19:51 $ + * last change: $Author: fs $ $Date: 2002-10-04 08:33:18 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -89,13 +89,7 @@ namespace cppu static void realloc( Sequence< Reference< XInterface > > & rSeq, sal_Int32 nNewLen ) SAL_THROW( () ) { - Sequence< Reference< XInterface > > aNewSeq( nNewLen ); - Reference< XInterface > * pDest = aNewSeq.getArray(); - // getArray on a const sequence is faster - const Reference< XInterface > * pSource = ((const Sequence< Reference< XInterface > > &)rSeq).getConstArray(); - for( sal_Int32 i = (nNewLen < rSeq.getLength() ? nNewLen : rSeq.getLength()) -1; i >= 0; i-- ) - pDest[i] = pSource[i]; - rSeq = aNewSeq; + rSeq.realloc( nNewLen ); } /** |