diff --git a/source/dyaml/scanner.d b/source/dyaml/scanner.d index 42cb886..b848eda 100644 --- a/source/dyaml/scanner.d +++ b/source/dyaml/scanner.d @@ -857,15 +857,13 @@ final class Scanner return reader_.get(length); } - /// Scan all characters until next line break. - dchar[] scanToNextBreak() @safe pure nothrow @nogc + /// Scan and throw away all characters until next line break. + void scanToNextBreak() @safe pure nothrow @nogc { - uint length = 0; - while(!"\0\n\r\u0085\u2028\u2029"d.canFind(reader_.peek(length))) + while(!"\0\n\r\u0085\u2028\u2029"d.canFind(reader_.peek())) { - ++length; + reader_.forward(); } - return reader_.get(length); } /// Scan all characters until next line break.