diff options
Diffstat (limited to 'src/qml/jsruntime/qv4regexpobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4regexpobject.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4regexpobject.cpp b/src/qml/jsruntime/qv4regexpobject.cpp index c2171d7c0e..16b9295ab7 100644 --- a/src/qml/jsruntime/qv4regexpobject.cpp +++ b/src/qml/jsruntime/qv4regexpobject.cpp @@ -726,12 +726,12 @@ ReturnedValue RegExpPrototype::method_replace(const FunctionObject *f, const Val if (scope.hasException()) return Encode::undefined(); if (position >= nextSourcePosition) { - accumulatedResult += s->toQString().midRef(nextSourcePosition, position - nextSourcePosition) + replacement; + accumulatedResult += QStringView{s->toQString()}.mid(nextSourcePosition, position - nextSourcePosition) + replacement; nextSourcePosition = position + matchLength; } } if (nextSourcePosition < lengthS) { - accumulatedResult += s->toQString().midRef(nextSourcePosition); + accumulatedResult += QStringView{s->toQString()}.mid(nextSourcePosition); } return scope.engine->newString(accumulatedResult)->asReturnedValue(); } |