Guest User

Untitled

a guest
Mar 22nd, 2019
92
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. From 447a7f2a7d4bb3e27acb22b7c1f4dc478d28c467 Mon Sep 17 00:00:00 2001
  2. From: Maciej Cencora <m.cencora@gmail.com>
  3. Date: Fri, 22 Mar 2019 13:44:57 +0100
  4. Subject: [PATCH] Avoid unnecessary memory allocations
  5.  
  6. ---
  7. src/engine/contactid.cpp | 6 +++---
  8.  1 file changed, 3 insertions(+), 3 deletions(-)
  9.  
  10. diff --git a/src/engine/contactid.cpp b/src/engine/contactid.cpp
  11. index 7f7c733..aea0aa5 100644
  12. --- a/src/engine/contactid.cpp
  13. +++ b/src/engine/contactid.cpp
  14. @@ -41,13 +41,13 @@ const QString default_uri = QString::fromLatin1("org.nemomobile.contacts.sqlite"
  15.  
  16.  QString dbIdToString(quint32 dbId)
  17.  {
  18. -    return QString::fromLatin1("sql-%1").arg(dbId);
  19. +    return QStringLiteral("sql-%1").arg(dbId);
  20.  }
  21.  
  22.  quint32 dbIdFromString(const QString &s)
  23.  {
  24. -    if (s.startsWith(QString::fromLatin1("sql-"))) {
  25. -        return s.mid(4).toUInt();
  26. +    if (s.startsWith(QLatin1String("sql-"))) {
  27. +        return s.midRef(4).toUInt();
  28.      }
  29.      return 0;
  30.  }
  31. --
  32. 2.19.1
RAW Paste Data