summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-08-22 16:50:29 +0200
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-10-10 09:57:14 +0000
commit472c93ddeea83fe90286e8ec395e17cd73ccfca4 (patch)
treed402a64a23704711b456aa771bba4f845de528cf
parent0230b2daae8132e30268ea719edbe4fb132201b9 (diff)
optimize operator+ ProString vs. char*
we have all necessary overloads now. Change-Id: Ic4472eba15d4234e968fcb9443d0f79011aa43fd Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from qtbase/f137957e0887a9321b69b9ba83ed6ccaedee57bb) (cherry picked from qtbase/1df4b2a3609d977cc8123f1f82e454d0333287d4)
-rw-r--r--src/linguist/shared/proitems.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/linguist/shared/proitems.h b/src/linguist/shared/proitems.h
index 687f39b70..e6acde9af 100644
--- a/src/linguist/shared/proitems.h
+++ b/src/linguist/shared/proitems.h
@@ -208,9 +208,9 @@ inline QString operator+(const QString &one, const ProString &two)
{ return ProString(one) + two; }
inline QString operator+(const ProString &one, const char *two)
- { return one + ProString(two); } // XXX optimize
+ { QString ret = one.toQStringRef() + QLatin1String(two); ret.detach(); return ret; }
inline QString operator+(const char *one, const ProString &two)
- { return ProString(one) + two; } // XXX optimize
+ { QString ret = QLatin1String(one) + two.toQStringRef(); ret.detach(); return ret; }
inline QString &operator+=(QString &that, const ProString &other)
{ return that += other.toQStringRef(); }