aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Serialization/External/LandDataSerializer.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-07-11 22:54:22 +0100
committerJustin Clark-Casey (justincc)2012-07-11 22:54:22 +0100
commit916e3bf886ee622e2f18d6eb74f90fee8c630471 (patch)
tree69f9a6d2a7f7041966400f56f46c198f2cc06158 /OpenSim/Framework/Serialization/External/LandDataSerializer.cs
parentFix build break for windows with missing package for IScriptEngine in prebuil... (diff)
downloadopensim-SC_OLD-916e3bf886ee622e2f18d6eb74f90fee8c630471.zip
opensim-SC_OLD-916e3bf886ee622e2f18d6eb74f90fee8c630471.tar.gz
opensim-SC_OLD-916e3bf886ee622e2f18d6eb74f90fee8c630471.tar.bz2
opensim-SC_OLD-916e3bf886ee622e2f18d6eb74f90fee8c630471.tar.xz
Where possible, use the system Encoding.ASCII and Encoding.UTF8 rather than constructing fresh copies.
The encodings are thread-safe and already used in such a manner in other places. This isn't done where Byte Order Mark output is suppressed, since Encoding.UTF8 is constructed to output the BOM.
Diffstat (limited to 'OpenSim/Framework/Serialization/External/LandDataSerializer.cs')
-rw-r--r--OpenSim/Framework/Serialization/External/LandDataSerializer.cs4
1 files changed, 1 insertions, 3 deletions
diff --git a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs
index e8d82d3..a64f01c 100644
--- a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs
+++ b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs
@@ -44,8 +44,6 @@ namespace OpenSim.Framework.Serialization.External
44 { 44 {
45// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 45// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
46 46
47 protected static UTF8Encoding m_utf8Encoding = new UTF8Encoding();
48
49 private static Dictionary<string, Action<LandData, XmlTextReader>> m_ldProcessors 47 private static Dictionary<string, Action<LandData, XmlTextReader>> m_ldProcessors
50 = new Dictionary<string, Action<LandData, XmlTextReader>>(); 48 = new Dictionary<string, Action<LandData, XmlTextReader>>();
51 49
@@ -163,7 +161,7 @@ namespace OpenSim.Framework.Serialization.External
163 /// <exception cref="System.Xml.XmlException"></exception> 161 /// <exception cref="System.Xml.XmlException"></exception>
164 public static LandData Deserialize(byte[] serializedLandData) 162 public static LandData Deserialize(byte[] serializedLandData)
165 { 163 {
166 return Deserialize(m_utf8Encoding.GetString(serializedLandData, 0, serializedLandData.Length)); 164 return Deserialize(Encoding.UTF8.GetString(serializedLandData, 0, serializedLandData.Length));
167 } 165 }
168 166
169 /// <summary> 167 /// <summary>