gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/rtmp r9811: don't copy data if none has be


From: rob
Subject: [Gnash-commit] /srv/bzr/gnash/rtmp r9811: don't copy data if none has been used yet.
Date: Sun, 30 Nov 2008 15:08:37 -0700
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9811
committer: address@hidden
branch nick: rtmp
timestamp: Sun 2008-11-30 15:08:37 -0700
message:
  don't copy data if none has been used yet.
modified:
  libamf/buffer.cpp
=== modified file 'libamf/buffer.cpp'
--- a/libamf/buffer.cpp 2008-11-29 01:07:40 +0000
+++ b/libamf/buffer.cpp 2008-11-30 22:08:37 +0000
@@ -638,6 +638,14 @@
 {
     GNASH_REPORT_FUNCTION;
     boost::scoped_array<gnash::Network::byte_t> tmp;
+
+    // If we don't have any data yet in this buffer, resizing is cheap, as
+    // we don't havce to copy any data.
+    if (_seekptr == _data.get()) {
+       _data.reset(new Network::byte_t[size]);
+       _nbytes= size;
+       return *this;
+    }
     
     if (_nbytes == 0) {
        return init(size);


reply via email to

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