From 33b2a7ef682ec2206bea2987e71c5b13abdbffc3 Mon Sep 17 00:00:00 2001 From: Ferdinand Majerech Date: Tue, 29 Jul 2014 23:23:45 +0200 Subject: [PATCH] Removed the UTF-32 buffer from Reader. --- source/dyaml/reader.d | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/dyaml/reader.d b/source/dyaml/reader.d index 768eb06..cbbcf5e 100644 --- a/source/dyaml/reader.d +++ b/source/dyaml/reader.d @@ -54,7 +54,6 @@ final class Reader { private: // Buffer of currently loaded characters. - dchar[] buffer_ = null; char[] buffer8_ = null; // Current position within buffer. Only data after this position can be read. @@ -121,16 +120,16 @@ final class Reader throw new ReaderException("UTF decoding error: " ~ msg); } - buffer_ = decodeResult.decoded; + auto buffer = decodeResult.decoded; // Check that excluding any trailing zeroes, all character in buffer are // printable. - auto noZeros = buffer_; + auto noZeros = buffer; while(!noZeros.empty && noZeros.back == '\0') { noZeros.popBack(); } enforce(printable(noZeros[]), new ReaderException("Special unicode characters are not allowed")); //TEMP (UTF-8 will be the default) - buffer8_ = cast(char[])buffer_.to!string; + buffer8_ = cast(char[])buffer.to!string; const validateResult = buffer8_.validateUTF8NoGC; enforce(validateResult.valid, new ReaderException(validateResult.msg ~