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/qstringview.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/qstringview.h')
-rw-r--r-- | src/corelib/text/qstringview.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/text/qstringview.h b/src/corelib/text/qstringview.h index 17b60fdc42..58412974bc 100644 --- a/src/corelib/text/qstringview.h +++ b/src/corelib/text/qstringview.h @@ -280,7 +280,7 @@ public: { Q_ASSERT(n >= 0); Q_ASSERT(n <= size()); return QStringView(m_data, n); } Q_REQUIRED_RESULT constexpr QStringView last(qsizetype n) const { Q_ASSERT(n >= 0); Q_ASSERT(n <= size()); return QStringView(m_data + size() - n, n); } - Q_REQUIRED_RESULT constexpr QStringView from(qsizetype pos) const + Q_REQUIRED_RESULT constexpr QStringView sliced(qsizetype pos) const { Q_ASSERT(pos >= 0); Q_ASSERT(pos <= size()); return QStringView(m_data + pos, size() - pos); } Q_REQUIRED_RESULT constexpr QStringView 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 QStringView(m_data + pos, n); } |