From 696ff71de2debe38c539551c1e269588e23ec098 Mon Sep 17 00:00:00 2001 From: Atsushi Eno Date: Tue, 5 Apr 2011 20:26:09 +0900 Subject: [PATCH] Revert PushbackReader changes (was unnecessary and actually bogus). --- .../JsonReader.cs | 27 +--------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonReader.cs b/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonReader.cs index c85f53cad61..a5cff6dfbf5 100644 --- a/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonReader.cs +++ b/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonReader.cs @@ -245,20 +245,10 @@ namespace System.Runtime.Serialization.Json class PushbackReader : StreamReader { Stack pushback; - Encoding encoding; - bool is_ascii_single; - byte [] encbuf; - char [] charbuf; public PushbackReader (Stream stream, Encoding encoding) : base (stream, encoding) { pushback = new Stack(); - this.encoding = encoding; -#if MOONLIGHT - is_ascii_single = encoding is UTF8Encoding; -#else - is_ascii_single = encoding is UTF8Encoding || encoding.IsSingleByte; -#endif } public PushbackReader (Stream stream) : this (new EncodingDetecingInputStream (stream)) @@ -296,22 +286,7 @@ namespace System.Runtime.Serialization.Json public void Pushback (int ch) { - if (ch < 0) - pushback.Push (ch); - else { - if (!is_ascii_single) { - if (encbuf == null) { - encbuf = new byte [encoding.GetMaxByteCount (1)]; - charbuf = new char [1]; - } - charbuf [0] = (char) ch; - int size = encoding.GetBytes (charbuf, 0, 1, encbuf, 0); - for (int i = 0; i < size; i++) - pushback.Push (encbuf [i]); - } - else - pushback.Push (ch); - } + pushback.Push (ch); } } -- 2.11.4.GIT