From df43ef7b6dde35c13d2d06ad69c2d63f66b237fb Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 30 Mar 2017 19:19:45 +0200 Subject: [PATCH] QStringBuilder: simplify QConcatenable ... by delegating to QConcatenable. The only thing that varied was the nested type alias 'type', which therefore got retained. Change-Id: I202f899034e1ddd23c6d1978a31be5eb7c195697 Reviewed-by: Thiago Macieira --- src/corelib/tools/qstringbuilder.h | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/src/corelib/tools/qstringbuilder.h b/src/corelib/tools/qstringbuilder.h index b2832b5fbe..9a40abcfed 100644 --- a/src/corelib/tools/qstringbuilder.h +++ b/src/corelib/tools/qstringbuilder.h @@ -277,25 +277,6 @@ template <> struct QConcatenable : private QAbstractConcatenable } }; -template struct QConcatenable : private QAbstractConcatenable -{ - typedef char type[N]; - typedef QByteArray ConvertTo; - enum { ExactSize = false }; - static int size(const char[N]) { return N - 1; } -#ifndef QT_NO_CAST_FROM_ASCII - static inline void QT_ASCII_CAST_WARN appendTo(const char a[N], QChar *&out) - { - QAbstractConcatenable::convertFromAscii(a, N - 1, out); - } -#endif - static inline void appendTo(const char a[N], char *&out) - { - while (*a) - *out++ = *a++; - } -}; - template struct QConcatenable : private QAbstractConcatenable { typedef const char type[N]; @@ -315,6 +296,11 @@ template struct QConcatenable : private QAbstractConcaten } }; +template struct QConcatenable : QConcatenable +{ + typedef char type[N]; +}; + template <> struct QConcatenable : private QAbstractConcatenable { typedef char const *type;