Commit b24fece4 authored by Milian Wolff's avatar Milian Wolff

Prevent repetitive temporary allocation of strings.

This data is static, and should be declared such. Doing so gets
rid of thousands of temporary allocations.

REVIEW: 121405
parent 85978177
......@@ -21,8 +21,6 @@
using namespace Akonadi;
static const char *s_accessRightsIdentifier = "AccessRights";
static Collection::Rights dataToRights(const QByteArray &data)
{
Collection::Rights rights = Collection::ReadOnly;
......@@ -142,6 +140,7 @@ CollectionRightsAttribute *CollectionRightsAttribute::clone() const
QByteArray CollectionRightsAttribute::type() const
{
static const QByteArray s_accessRightsIdentifier("AccessRights");
return s_accessRightsIdentifier;
}
......
......@@ -177,7 +177,7 @@ bool LinkLocator::atUrl() const
{
// the following characters are allowed in a dot-atom (RFC 2822):
// a-z A-Z 0-9 . ! # $ % & ' * + - / = ? ^ _ ` { | } ~
const QString allowedSpecialChars = QLatin1String( ".!#$%&'*+-/=?^_`{|}~" );
static const QString allowedSpecialChars = QLatin1String( ".!#$%&'*+-/=?^_`{|}~" );
// the character directly before the URL must not be a letter, a number or
// any other character allowed in a dot-atom (RFC 2822).
......@@ -229,7 +229,7 @@ QString LinkLocator::getEmailAddress()
if ( mText[mPos] == QLatin1Char('@') ) {
// the following characters are allowed in a dot-atom (RFC 2822):
// a-z A-Z 0-9 . ! # $ % & ' * + - / = ? ^ _ ` { | } ~
const QString allowedSpecialChars = QLatin1String( ".!#$%&'*+-/=?^_`{|}~" );
static const QString allowedSpecialChars = QLatin1String( ".!#$%&'*+-/=?^_`{|}~" );
// determine the local part of the email address
int start = mPos - 1;
......
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