Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/aspnet/MessagePack-CSharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoshifumi Kawai <ils@neue.cc>2020-01-15 20:14:53 +0300
committerYoshifumi Kawai <ils@neue.cc>2020-01-15 20:14:53 +0300
commitf2dfba86bdfb1566adea26513e96541932916206 (patch)
tree15987a6fe40c62bf22bff43537db9b389b02da55
parent9ebbb60bb7fe3c660fcc9d25311b14753b2ac0fe (diff)
remove deserialize fallback of decimal
-rw-r--r--src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Formatters/StandardClassLibraryFormatter.cs16
1 files changed, 1 insertions, 15 deletions
diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Formatters/StandardClassLibraryFormatter.cs b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Formatters/StandardClassLibraryFormatter.cs
index efcefb70..c82f1a0a 100644
--- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Formatters/StandardClassLibraryFormatter.cs
+++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Formatters/StandardClassLibraryFormatter.cs
@@ -184,21 +184,7 @@ namespace MessagePack.Formatters
}
}
- // fallback
- {
- var seqLen = (int)sequence.Length;
- var rentArray = ArrayPool<byte>.Shared.Rent(seqLen);
- try
- {
- sequence.CopyTo(rentArray);
- var str = Encoding.UTF8.GetString(rentArray.AsSpan(0, seqLen));
- return decimal.Parse(str, CultureInfo.InvariantCulture);
- }
- finally
- {
- ArrayPool<byte>.Shared.Return(rentArray);
- }
- }
+ throw new MessagePackSerializationException("Can't parse to decimal, input string was not in a correct format.");
}
}