Minor optimization in decode

This commit is contained in:
Andrei Alexandrescu 2009-10-27 03:29:55 +00:00
parent 904f56e34a
commit dbd4e31f19
4 changed files with 20 additions and 18 deletions

View file

@ -388,8 +388,7 @@ string decode(string s, DecodeMode mode=DecodeMode.LOOSE)
{
if (buffer.length == 0)
{
buffer = s.dup;
buffer.length = i;
buffer = s[0 .. i].dup;
}
if (startsWith(s[i..$],"&#"))
{