Changeset 170050 in webkit


Ignore:
Timestamp:
Jun 17, 2014 12:47:27 AM (10 years ago)
Author:
zandobersek@gmail.com
Message:

Avoid Vector<char> copies in the OffsetBuffer constructor
https://bugs.webkit.org/show_bug.cgi?id=133956

Reviewed by Andreas Kling.

  • xml/parser/XMLDocumentParserLibxml2.cpp:

(WebCore::OffsetBuffer::OffsetBuffer): Take the Vector parameter by value and
move it into the member variable.
(WebCore::openFunc): Move the Vector object into the OffsetBuffer constructor.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r170049 r170050  
     12014-06-17  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        Avoid Vector<char> copies in the OffsetBuffer constructor
     4        https://bugs.webkit.org/show_bug.cgi?id=133956
     5
     6        Reviewed by Andreas Kling.
     7
     8        * xml/parser/XMLDocumentParserLibxml2.cpp:
     9        (WebCore::OffsetBuffer::OffsetBuffer): Take the Vector parameter by value and
     10        move it into the member variable.
     11        (WebCore::openFunc): Move the Vector object into the OffsetBuffer constructor.
     12
    1132014-06-17  Jer Noble  <jer.noble@apple.com>
    214
  • trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp

    r166585 r170050  
    362362    WTF_MAKE_FAST_ALLOCATED;
    363363public:
    364     OffsetBuffer(const Vector<char>& b) : m_buffer(b), m_currentOffset(0) { }
     364    OffsetBuffer(Vector<char> buffer)
     365        : m_buffer(std::move(buffer))
     366        , m_currentOffset(0)
     367    {
     368    }
    365369
    366370    int readOutBytes(char* outputBuffer, unsigned askedToRead)
     
    466470        return &globalDescriptor;
    467471
    468     return new OffsetBuffer(data);
     472    return new OffsetBuffer(std::move(data));
    469473}
    470474
Note: See TracChangeset for help on using the changeset viewer.