Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 788be812 authored by Laurent Montel's avatar Laurent Montel 😁

Minor optimization

parent dd72a7f2
......@@ -214,9 +214,9 @@ QString AutoCreateScriptUtil::generateConditionComment(const QString &comment)
{
QString strComment;
if (!comment.trimmed().isEmpty()) {
const QStringList commentList = comment.split(QLatin1Char('\n'));
const QVector<QStringRef> commentList = comment.splitRef(QLatin1Char('\n'));
for (const QString &str : commentList) {
for (const QStringRef &str : commentList) {
if (str.isEmpty()) {
strComment += QLatin1Char('\n');
} else {
......
......@@ -97,9 +97,8 @@ void SieveActionWidget::generatedScript(QString &script, QStringList &requires,
indent += AutoCreateScriptUtil::indentation();
}
if (!comment.trimmed().isEmpty()) {
const QStringList commentList = comment.split(QLatin1Char('\n'));
for (const QString &str : commentList) {
const QVector<QStringRef> commentList = comment.splitRef(QLatin1Char('\n'));
for (const QStringRef &str : commentList) {
if (str.isEmpty()) {
script += QLatin1Char('\n');
} else {
......
......@@ -82,8 +82,8 @@ QString SieveScriptListItem::generatedScript(QStringList &requires) const
{
QString script;
if (!mDescription.trimmed().isEmpty()) {
const QStringList commentList = mDescription.split(QLatin1Char('\n'));
for (const QString &str : commentList) {
const QVector<QStringRef> commentList = mDescription.splitRef(QLatin1Char('\n'));
for (const QStringRef &str : commentList) {
if (str.isEmpty()) {
script += QLatin1Char('\n');
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment