Skip to content

Latest commit

 

History

History
15 lines (10 loc) · 425 Bytes

README-use-static-qregularexpression.md

File metadata and controls

15 lines (10 loc) · 425 Bytes

use-static-qregularexpression

Finds places such as

    QString str = ...;
    if (str.contains(QRegularExpression(...))) { ... }

    QRegularExpression re(...);
    if (str.indexOf(re, 0)) { ... }

and suggests to use a static QRegularExpression object instead to avoid recreating the regular expressions.

Note that it only checks for functions using QRegularExpression from QString and QStringList.