Simplify bformat

This commit is contained in:
Yuriy Skalko 2020-11-01 22:39:21 +02:00
parent ebfdac4fa3
commit c7d0ba0f26

View File

@ -1544,11 +1544,7 @@ docstring bformat(docstring const & fmt, docstring const & arg1, int arg2)
docstring bformat(docstring const & fmt, char const * arg1, docstring const & arg2)
{
LATTEST(contains(fmt, from_ascii("%1$s")));
LATTEST(contains(fmt, from_ascii("%2$s")));
docstring str = subst(fmt, from_ascii("%1$s"), from_ascii(arg1));
str = subst(str, from_ascii("%2$s"), arg2);
return subst(str, from_ascii("%%"), from_ascii("%"));
return bformat(fmt, from_ascii(arg1), arg2);
}