From 627f0a7f7d775ecd263b95dd07fca44bfcb0c5cf Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 3 Jul 2017 13:08:47 +0200 Subject: Doc: Improve documentation about append, prepend The references to the this pointer look somewhat alien in the documentation, because it isn't part of the signature. Rather make the relationship explicit. Change-Id: I6de516e165ea6e9c4ee2898836e9490fbaf4545c Reviewed-by: Thiago Macieira --- src/corelib/tools/qbytearray.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index 38df38a32f..0e7365c32b 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -1516,13 +1516,13 @@ void QByteArray::chop(int n) \snippet code/src_corelib_tools_qbytearray.cpp 12 Note: QByteArray is an \l{implicitly shared} class. Consequently, - if \e this is an empty QByteArray, then \e this will just share - the data held in \a ba. In this case, no copying of data is done, + if you append to an empty byte array, then the byte array will just + share the data held in \a ba. In this case, no copying of data is done, taking \l{constant time}. If a shared instance is modified, it will be copied (copy-on-write), taking \l{linear time}. - If \e this is not an empty QByteArray, a deep copy of the data is - performed, taking \l{linear time}. + If the byte array being appended to is not empty, a deep copy of the + data is performed, taking \l{linear time}. This operation typically does not suffer from allocation overhead, because QByteArray preallocates extra space at the end of the data @@ -1781,13 +1781,13 @@ QByteArray QByteArray::nulTerminated() const This is the same as insert(0, \a ba). Note: QByteArray is an \l{implicitly shared} class. Consequently, - if \e this is an empty QByteArray, then \e this will just share - the data held in \a ba. In this case, no copying of data is done, + if you prepend to an empty byte array, then the byte array will just + share the data held in \a ba. In this case, no copying of data is done, taking \l{constant time}. If a shared instance is modified, it will be copied (copy-on-write), taking \l{linear time}. - If \e this is not an empty QByteArray, a deep copy of the data is - performed, taking \l{linear time}. + If the byte array being prepended to is not empty, a deep copy of the + data is performed, taking \l{linear time}. \sa append(), insert() */ @@ -1869,13 +1869,13 @@ QByteArray &QByteArray::prepend(char ch) This is the same as insert(size(), \a ba). Note: QByteArray is an \l{implicitly shared} class. Consequently, - if \e this is an empty QByteArray, then \e this will just share - the data held in \a ba. In this case, no copying of data is done, + if you append to an empty byte array, then the byte array will just + share the data held in \a ba. In this case, no copying of data is done, taking \l{constant time}. If a shared instance is modified, it will be copied (copy-on-write), taking \l{linear time}. - If \e this is not an empty QByteArray, a deep copy of the data is - performed, taking \l{linear time}. + If the byte array being appended to is not empty, a deep copy of the + data is performed, taking \l{linear time}. This operation typically does not suffer from allocation overhead, because QByteArray preallocates extra space at the end of the data -- cgit v1.2.3