minor: use the static ascii and utf8 encodings instead of instantiating our own

slimupdates
Justin Clark-Casey (justincc) 2010-04-16 22:38:42 +01:00
parent bf3956aeb0
commit e9926d13cf
1 changed files with 3 additions and 6 deletions

View File

@ -53,9 +53,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected static ASCIIEncoding m_asciiEncoding = new ASCIIEncoding();
protected static UTF8Encoding m_utf8Encoding = new UTF8Encoding();
protected Scene m_scene; protected Scene m_scene;
protected Stream m_loadStream; protected Stream m_loadStream;
protected Guid m_requestId; protected Guid m_requestId;
@ -140,7 +137,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
if (filePath.StartsWith(ArchiveConstants.OBJECTS_PATH)) if (filePath.StartsWith(ArchiveConstants.OBJECTS_PATH))
{ {
serialisedSceneObjects.Add(m_utf8Encoding.GetString(data)); serialisedSceneObjects.Add(Encoding.UTF8.GetString(data));
} }
else if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH) && !m_skipAssets) else if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH) && !m_skipAssets)
{ {
@ -162,7 +159,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
} }
else if (!m_merge && filePath.StartsWith(ArchiveConstants.LANDDATA_PATH)) else if (!m_merge && filePath.StartsWith(ArchiveConstants.LANDDATA_PATH))
{ {
serialisedParcels.Add(m_utf8Encoding.GetString(data)); serialisedParcels.Add(Encoding.UTF8.GetString(data));
} }
else if (filePath == ArchiveConstants.CONTROL_FILE_PATH) else if (filePath == ArchiveConstants.CONTROL_FILE_PATH)
{ {
@ -551,7 +548,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
XmlParserContext context = new XmlParserContext(null, nsmgr, null, XmlSpace.None); XmlParserContext context = new XmlParserContext(null, nsmgr, null, XmlSpace.None);
XmlTextReader xtr XmlTextReader xtr
= new XmlTextReader(m_asciiEncoding.GetString(data), XmlNodeType.Document, context); = new XmlTextReader(Encoding.ASCII.GetString(data), XmlNodeType.Document, context);
RegionSettings currentRegionSettings = m_scene.RegionInfo.RegionSettings; RegionSettings currentRegionSettings = m_scene.RegionInfo.RegionSettings;