From 7a2c4f6c71491f3d7b1d00d90bc5b2a7a261d7c6 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Sun, 13 Nov 2022 10:21:52 +0100 Subject: [PATCH] Make regex static and const Signed-off-by: Carl Schwan --- src/neochatroom.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/neochatroom.cpp b/src/neochatroom.cpp index 1a2b3a830..dbd92aa30 100644 --- a/src/neochatroom.cpp +++ b/src/neochatroom.cpp @@ -304,16 +304,16 @@ QDateTime NeoChatRoom::lastActiveTime() QString NeoChatRoom::subtitleText() { QString subtitle = this->lastEventToString().size() == 0 ? this->topic() : this->lastEventToString(); - static QRegularExpression blockquote("(\r\n\t|\n|\r\t|)> "); - static QRegularExpression heading("(\r\n\t|\n|\r\t|)\\#{1,6} "); - static QRegularExpression newlines("(\r\n\t|\n|\r\t)"); - static QRegularExpression bold1("(\\*\\*|__)(?=\\S)([^\\r]*\\S)\\1"); - static QRegularExpression bold2("(\\*|_)(?=\\S)([^\\r]*\\S)\\1"); - static QRegularExpression strike1("~~(.*)~~"); - static QRegularExpression strike2("~(.*)~"); - static QRegularExpression del("(.*)"); - static QRegularExpression multileLineCode("```([^```]+)```"); - static QRegularExpression singleLinecode("`([^`]+)`"); + static const QRegularExpression blockquote("(\r\n\t|\n|\r\t|)> "); + static const QRegularExpression heading("(\r\n\t|\n|\r\t|)\\#{1,6} "); + static const QRegularExpression newlines("(\r\n\t|\n|\r\t)"); + static const QRegularExpression bold1("(\\*\\*|__)(?=\\S)([^\\r]*\\S)\\1"); + static const QRegularExpression bold2("(\\*|_)(?=\\S)([^\\r]*\\S)\\1"); + static const QRegularExpression strike1("~~(.*)~~"); + static const QRegularExpression strike2("~(.*)~"); + static const QRegularExpression del("(.*)"); + static const QRegularExpression multileLineCode("```([^```]+)```"); + static const QRegularExpression singleLinecode("`([^`]+)`"); subtitle // replace blockquote, i.e. '> text'