From 1c579565acd7629326996fbaeae5750572c89c3e Mon Sep 17 00:00:00 2001 From: Konstantina Chremmou Date: Thu, 30 Nov 2017 15:34:36 +0000 Subject: [PATCH] Create the settings object only in DEBUG mode. --- XenModel/XenAPI/JsonRpc.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/XenModel/XenAPI/JsonRpc.cs b/XenModel/XenAPI/JsonRpc.cs index 2ff2e4b52..6f385038f 100644 --- a/XenModel/XenAPI/JsonRpc.cs +++ b/XenModel/XenAPI/JsonRpc.cs @@ -212,7 +212,9 @@ namespace XenAPI // for performance reasons it's preferable to deserialize directly // from the Stream rather than allocating strings inbetween // therefore the latter will be done only in DEBUG mode +#if DEBUG var settings = new JsonSerializerSettings {Formatting = Formatting.Indented, Converters = serializer.Converters}; +#endif using (var str = webRequest.GetRequestStream()) using (var sw = new StreamWriter(str))