diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-06-27 11:26:42 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-07-06 21:31:35 +0200 |
commit | 9117e3850b9d395a9741fa4b63c5b59ea7767390 (patch) | |
tree | 8a30c1c8654724e6cd3270e8d679024390c58186 /src/corelib/text/qbytearray.h | |
parent | e5fbe10647d35e4c27413a29a08376e3335e16b0 (diff) |
Rename from() to sliced()
After API discussions, agreement was that from(n) is a bad name
for the method. Let's go with sliced(n) instead.
Change-Id: I0338cc150148a5008c3ee72bd8fda96fb93e9c35
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/text/qbytearray.h')
-rw-r--r-- | src/corelib/text/qbytearray.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/text/qbytearray.h b/src/corelib/text/qbytearray.h index f4d4bf0745..045a05c54a 100644 --- a/src/corelib/text/qbytearray.h +++ b/src/corelib/text/qbytearray.h @@ -226,7 +226,7 @@ public: { Q_ASSERT(n >= 0); Q_ASSERT(n <= size()); return QByteArray(data(), int(n)); } Q_REQUIRED_RESULT QByteArray last(qsizetype n) const { Q_ASSERT(n >= 0); Q_ASSERT(n <= size()); return QByteArray(data() + size() - n, int(n)); } - Q_REQUIRED_RESULT QByteArray from(qsizetype pos) const + Q_REQUIRED_RESULT QByteArray sliced(qsizetype pos) const { Q_ASSERT(pos >= 0); Q_ASSERT(pos <= size()); return QByteArray(data() + pos, size() - int(pos)); } Q_REQUIRED_RESULT QByteArray sliced(qsizetype pos, qsizetype n) const { Q_ASSERT(pos >= 0); Q_ASSERT(n >= 0); Q_ASSERT(size_t(pos) + size_t(n) <= size_t(size())); return QByteArray(data() + pos, int(n)); } |