From a2cbb90d4e307fee6749423bc9a5922b868e9077 Mon Sep 17 00:00:00 2001 From: Ferdinand Majerech Date: Thu, 24 Jul 2014 02:43:28 +0200 Subject: [PATCH] SliceBuilder is now a part of Reader. --- source/dyaml/reader.d | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/dyaml/reader.d b/source/dyaml/reader.d index 83a8d62..4073635 100644 --- a/source/dyaml/reader.d +++ b/source/dyaml/reader.d @@ -121,6 +121,8 @@ final class Reader while(!noZeros.empty && noZeros.back == '\0') { noZeros.popBack(); } enforce(printable(noZeros[]), new ReaderException("Special unicode characters are not allowed")); + + this.sliceBuilder = SliceBuilder(this); } /// Get character at specified index relative to current position. @@ -226,6 +228,9 @@ final class Reader } } + /// Used to build slices of read data in Reader; to avoid allocations. + SliceBuilder sliceBuilder; + /// Get a string describing current buffer position, used for error messages. final Mark mark() @safe pure nothrow const @nogc { return Mark(line_, column_); }