From 9117e3850b9d395a9741fa4b63c5b59ea7767390 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Sat, 27 Jun 2020 11:26:42 +0200 Subject: 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 --- src/corelib/text/qbytearray.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/text/qbytearray.h') 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)); } -- cgit v1.2.3