From 0bfb193e47328d7f15a1a837f4c7c1ca9f450311 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Wed, 25 May 2011 15:31:09 +0200 Subject: [PATCH] fix deserialisation of consecutive integer ranges --- .../XmlBamlReader.cs | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlReader.cs b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlReader.cs index a56c9afa5..93ed72c66 100644 --- a/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlReader.cs +++ b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlReader.cs @@ -776,34 +776,23 @@ namespace Ricciolo.StylesExplorer.MarkupReflection throw new ArgumentException(); Int32Collection ints = new Int32Collection(capacity); - switch (type) - { + switch (type) { case IntegerCollectionType.Byte: for (int i = 0; i < capacity; i++) - { ints.Add(reader.ReadByte()); - } return ints; - case IntegerCollectionType.UShort: for (int j = 0; j < capacity; j++) - { ints.Add(reader.ReadUInt16()); - } return ints; - case IntegerCollectionType.Integer: for (int k = 0; k < capacity; k++) - { ints.Add(reader.ReadInt32()); - } return ints; - case IntegerCollectionType.Consecutive: - for (int m = reader.ReadInt32(); m < capacity; m++) - { + int start = reader.ReadInt32(); + for (int m = start; m < capacity + start; m++) ints.Add(m); - } return ints; } throw new ArgumentException();