Create the settings object only in DEBUG mode.

This commit is contained in:
Konstantina Chremmou 2017-11-30 15:34:36 +00:00
parent a623e28a06
commit 1c579565ac

View File

@ -212,7 +212,9 @@ namespace XenAPI
// for performance reasons it's preferable to deserialize directly // for performance reasons it's preferable to deserialize directly
// from the Stream rather than allocating strings inbetween // from the Stream rather than allocating strings inbetween
// therefore the latter will be done only in DEBUG mode // therefore the latter will be done only in DEBUG mode
#if DEBUG
var settings = new JsonSerializerSettings {Formatting = Formatting.Indented, Converters = serializer.Converters}; var settings = new JsonSerializerSettings {Formatting = Formatting.Indented, Converters = serializer.Converters};
#endif
using (var str = webRequest.GetRequestStream()) using (var str = webRequest.GetRequestStream())
using (var sw = new StreamWriter(str)) using (var sw = new StreamWriter(str))