diff --git a/format.cc b/format.cc index 86fb6b69..5103c61f 100644 --- a/format.cc +++ b/format.cc @@ -1192,7 +1192,6 @@ const Char *fmt::BasicFormatter::format( if (*s++ != '}') FMT_THROW(FormatError("missing '}' in format string")); - start_ = s; // Format argument. internal::ArgFormatter(*this, spec, s - 1).visit(arg); @@ -1202,23 +1201,24 @@ const Char *fmt::BasicFormatter::format( template void fmt::BasicFormatter::format( BasicCStringRef format_str, const ArgList &args) { - const Char *s = start_ = format_str.c_str(); + const Char *s = format_str.c_str(); + const Char *start = s; set_args(args); while (*s) { Char c = *s++; if (c != '{' && c != '}') continue; if (*s == c) { - write(writer_, start_, s); - start_ = ++s; + write(writer_, start, s); + start = ++s; continue; } if (c == '}') FMT_THROW(FormatError("unmatched '}' in format string")); - write(writer_, start_, s - 1); + write(writer_, start, s - 1); Arg arg = is_name_start(*s) ? parse_arg_name(s) : parse_arg_index(s); - s = format(s, arg); + start = s = format(s, arg); } - write(writer_, start_, s); + write(writer_, start, s); } FMT_FUNC void fmt::report_system_error( diff --git a/format.h b/format.h index 67bf231d..9208b7e9 100644 --- a/format.h +++ b/format.h @@ -1326,7 +1326,6 @@ template class BasicFormatter : private internal::FormatterBase { private: BasicWriter &writer_; - const Char *start_; internal::ArgMap map_; FMT_DISALLOW_COPY_AND_ASSIGN(BasicFormatter);