activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r552828 - in /activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/io: BlockingByteArrayInputStream.cpp ByteArrayInputStream.cpp
Date Tue, 03 Jul 2007 13:22:14 GMT
Author: tabish
Date: Tue Jul  3 06:22:13 2007
New Revision: 552828

URL: http://svn.apache.org/viewvc?view=rev&rev=552828
Log:
http://issues.apache.org/activemq/browse/AMQCPP-103

Building Decaf lib, optimizations

Modified:
    activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/io/BlockingByteArrayInputStream.cpp
    activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/io/ByteArrayInputStream.cpp

Modified: activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/io/BlockingByteArrayInputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/io/BlockingByteArrayInputStream.cpp?view=diff&rev=552828&r1=552827&r2=552828
==============================================================================
--- activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/io/BlockingByteArrayInputStream.cpp
(original)
+++ activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/io/BlockingByteArrayInputStream.cpp
Tue Jul  3 06:22:13 2007
@@ -48,13 +48,12 @@
     synchronized( this ){
 
         // Remove old data
-        this->buffer.clear();
+        buffer.clear();
+        buffer.reserve( lbufferSize );
 
         // Copy data to internal buffer.
-        for( std::size_t ix = 0; ix < lbufferSize; ++ix )
-        {
-            this->buffer.push_back(lbuffer[ix]);
-        }
+        std::back_insert_iterator< std::vector<unsigned char> > iter( buffer
);
+        std::copy( lbuffer, lbuffer + lbufferSize, iter );
 
         // Begin at the Beginning.
         pos = this->buffer.begin();

Modified: activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/io/ByteArrayInputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/io/ByteArrayInputStream.cpp?view=diff&rev=552828&r1=552827&r2=552828
==============================================================================
--- activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/io/ByteArrayInputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/io/ByteArrayInputStream.cpp Tue Jul
 3 06:22:13 2007
@@ -64,7 +64,8 @@
     defaultBuffer.reserve( lbufferSize );
 
     // Copy data to internal buffer.
-    defaultBuffer.insert( defaultBuffer.end(), lbuffer, lbuffer + lbufferSize );
+    std::back_insert_iterator< std::vector<unsigned char> > iter( defaultBuffer
);
+    std::copy( buffer, buffer + len, iter );
 
     // Begin at the Beginning.
     reset();



Mime
View raw message