Efficiency fix for the formatting code

This commit is contained in:
John Wiegley 2009-02-19 12:49:25 -04:00
parent 2f083b8bdb
commit cae49a2998

View file

@ -262,6 +262,7 @@ void format_t::format(std::ostream& out_str, scope_t& scope)
break;
}
if (elem->max_width > 0 || elem->min_width > 0) {
unistring temp(out.str());
string result;
@ -272,8 +273,10 @@ void format_t::format(std::ostream& out_str, scope_t& scope)
for (int i = 0; i < (int)elem->min_width - (int)temp.length(); i++)
result += " ";
}
out_str << result;
} else {
out_str << out.str();
}
}
}