From 670a53258ef79ee92f578335577df4f768c9d7d4 Mon Sep 17 00:00:00 2001 From: LukePulverenti Luke Pulverenti luke pulverenti Date: Tue, 11 Sep 2012 14:20:12 -0400 Subject: Some minor code cleanups --- MediaBrowser.ApiInteraction/DataSerializer.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'MediaBrowser.ApiInteraction/DataSerializer.cs') diff --git a/MediaBrowser.ApiInteraction/DataSerializer.cs b/MediaBrowser.ApiInteraction/DataSerializer.cs index ae3a72e622..2783f4ea12 100644 --- a/MediaBrowser.ApiInteraction/DataSerializer.cs +++ b/MediaBrowser.ApiInteraction/DataSerializer.cs @@ -12,7 +12,7 @@ namespace MediaBrowser.ApiInteraction /// This means that this class can currently only handle types within the Model project. /// If we need to, we can always add a param indicating whether or not the model serializer should be used. /// - private static ProtobufModelSerializer ProtobufModelSerializer = new ProtobufModelSerializer(); + private static readonly ProtobufModelSerializer ProtobufModelSerializer = new ProtobufModelSerializer(); /// /// Deserializes an object using generics @@ -20,16 +20,16 @@ namespace MediaBrowser.ApiInteraction public static T DeserializeFromStream(Stream stream, SerializationFormats format) where T : class { - if (format == ApiInteraction.SerializationFormats.Protobuf) + if (format == SerializationFormats.Protobuf) { //return Serializer.Deserialize(stream); return ProtobufModelSerializer.Deserialize(stream, null, typeof(T)) as T; } - else if (format == ApiInteraction.SerializationFormats.Jsv) + else if (format == SerializationFormats.Jsv) { return TypeSerializer.DeserializeFromStream(stream); } - else if (format == ApiInteraction.SerializationFormats.Json) + else if (format == SerializationFormats.Json) { return JsonSerializer.DeserializeFromStream(stream); } -- cgit v1.2.3