Simplify, don't special-case comments.

Not much is gained by using `tokenLength` anyway, use the slice length for everything.
`len` is now unsigned so the assert is obsolete.
This commit is contained in:
Bastiaan Veelo 2018-10-18 10:59:25 +02:00
parent f3fe504ed5
commit 5c28af1ac7
1 changed files with 1 additions and 2 deletions

View File

@ -533,8 +533,7 @@ private:
{ {
if (tokens[i].type == tok!"," || tokens[i].type == tok!";") if (tokens[i].type == tok!"," || tokens[i].type == tok!";")
break; break;
immutable len = tokens[i].type == tok!"comment" ? tokens[i].text.length : tokenLength(tokens[i]); immutable len = tokens[i].text.length;
assert(len >= 0);
lengthOfNextChunk += len; lengthOfNextChunk += len;
} }
assert(lengthOfNextChunk > 0); assert(lengthOfNextChunk > 0);