Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 12523 invoked from network); 8 Jul 2007 00:59:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Jul 2007 00:59:52 -0000 Received: (qmail 71990 invoked by uid 500); 8 Jul 2007 00:59:55 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 71967 invoked by uid 500); 8 Jul 2007 00:59:55 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 71958 invoked by uid 99); 8 Jul 2007 00:59:55 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Jul 2007 17:59:55 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Jul 2007 17:59:52 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id CE9C61A981A; Sat, 7 Jul 2007 17:59:31 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r554286 - /activemq/activemq-cpp/trunk/src/main/activemq/util/Properties.h Date: Sun, 08 Jul 2007 00:59:31 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070708005931.CE9C61A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Sat Jul 7 17:59:30 2007 New Revision: 554286 URL: http://svn.apache.org/viewvc?view=rev&rev=554286 Log: http://issues.apache.org/activemq/browse/AMQCPP-128 Properties performance increase Modified: activemq/activemq-cpp/trunk/src/main/activemq/util/Properties.h Modified: activemq/activemq-cpp/trunk/src/main/activemq/util/Properties.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/util/Properties.h?view=diff&rev=554286&r1=554285&r2=554286 ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/util/Properties.h (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/util/Properties.h Sat Jul 7 17:59:30 2007 @@ -92,6 +92,7 @@ virtual void setProperty( const std::string& name, const std::string& value ){ properties[name] = value; + //properties.insert( std::make_pair( name, value ) ); } /** @@ -126,15 +127,19 @@ virtual std::vector< std::pair< std::string, std::string > > toArray() const{ // Create a vector big enough to hold all the elements in the map. - std::vector< std::pair > vec( properties.size() ); + std::vector< std::pair > vec( + properties.begin(), properties.end() ); - // Get an iterator at the beginning of the map. - std::map< std::string, std::string >::const_iterator iter = properties.begin(); - - // Copy all of the elements from the map to the vector. - for( int ix=0; iter != properties.end(); ++iter, ++ix ){ - vec[ix] = *iter; - } +// // Create a vector big enough to hold all the elements in the map. +// std::vector< std::pair > vec( properties.size() ); +// +// // Get an iterator at the beginning of the map. +// std::map< std::string, std::string >::const_iterator iter = properties.begin(); +// +// // Copy all of the elements from the map to the vector. +// for( int ix=0; iter != properties.end(); ++iter, ++ix ){ +// vec[ix] = *iter; +// } return vec; }