Skip to content
  • Igor Kushnir's avatar
    QString=>QStringView in ParamIterator and related code · 1d971716
    Igor Kushnir authored
    This should improve performance by not creating unnecessary QString
    objects. A QString is never more useful than a QStringView in the
    changed code.
    
    Provide forwarding const QString& overloads of IndexedString, Identifier
    and QualifiedIdentifier constructors for two reasons:
    1. A QStringView is not constructible from a QStringBuilder expression.
       So explicit casting to QString would be necessary:
       -    return Identifier(QLatin1Char('~') + str);
       +    return Identifier(QString{QLatin1Char('~') + str});
    2. In kdev-php and possibly in other plugins QString arguments would
       have to be explicitly casted to QStringView in order to avoid
       ambiguous calls of overloaded IndexedString(const QString&) with
       const QUrl& and QStringView candidates. This reason can be eliminated
       by adding -DQT_NO_URL_CAST_FROM_STRING definition to CMakeLists.txt.
    1d971716