From 1f17447fac5b122caa490af0f47f407dcf724dcc Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Tue, 7 Jan 2014 08:44:15 -0800 Subject: [PATCH] Simplify pad. --- format.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/format.h b/format.h index 604fee71..935434b3 100644 --- a/format.h +++ b/format.h @@ -409,8 +409,8 @@ class StrFormatSpec : public AlignSpec { const T *str_; public: - StrFormatSpec(const T *str, const AlignSpec &spec) - : AlignSpec(spec), str_(str) {} + StrFormatSpec(const T *str, unsigned width, wchar_t fill) + : AlignSpec(width, fill), str_(str) {} const T *str() const { return str_; } }; @@ -507,12 +507,12 @@ DEFINE_INT_FORMATTERS(unsigned long long) template inline StrFormatSpec pad( const Char *str, unsigned width, Char fill = ' ') { - return StrFormatSpec(str, AlignSpec(width, fill)); + return StrFormatSpec(str, width, fill); } inline StrFormatSpec pad( const wchar_t *str, unsigned width, char fill = ' ') { - return StrFormatSpec(str, AlignSpec(width, fill)); + return StrFormatSpec(str, width, fill); } template