diff options
author | Justin Clark-Casey (justincc) | 2012-07-11 22:54:22 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-07-11 22:54:22 +0100 |
commit | 916e3bf886ee622e2f18d6eb74f90fee8c630471 (patch) | |
tree | 69f9a6d2a7f7041966400f56f46c198f2cc06158 /OpenSim/Server/Base/ServicesServerBase.cs | |
parent | Fix build break for windows with missing package for IScriptEngine in prebuil... (diff) | |
download | opensim-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 '')
-rw-r--r-- | OpenSim/Server/Base/ServicesServerBase.cs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/OpenSim/Server/Base/ServicesServerBase.cs b/OpenSim/Server/Base/ServicesServerBase.cs index 36c48e6..b137c05 100644 --- a/OpenSim/Server/Base/ServicesServerBase.cs +++ b/OpenSim/Server/Base/ServicesServerBase.cs | |||
@@ -27,9 +27,10 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.IO; | 29 | using System.IO; |
30 | using System.Xml; | ||
31 | using System.Threading; | ||
32 | using System.Reflection; | 30 | using System.Reflection; |
31 | using System.Threading; | ||
32 | using System.Text; | ||
33 | using System.Xml; | ||
33 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
34 | using OpenSim.Framework.Console; | 35 | using OpenSim.Framework.Console; |
35 | using log4net; | 36 | using log4net; |
@@ -335,8 +336,7 @@ namespace OpenSim.Server.Base | |||
335 | { | 336 | { |
336 | string pidstring = System.Diagnostics.Process.GetCurrentProcess().Id.ToString(); | 337 | string pidstring = System.Diagnostics.Process.GetCurrentProcess().Id.ToString(); |
337 | FileStream fs = File.Create(path); | 338 | FileStream fs = File.Create(path); |
338 | System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); | 339 | Byte[] buf = Encoding.ASCII.GetBytes(pidstring); |
339 | Byte[] buf = enc.GetBytes(pidstring); | ||
340 | fs.Write(buf, 0, buf.Length); | 340 | fs.Write(buf, 0, buf.Length); |
341 | fs.Close(); | 341 | fs.Close(); |
342 | m_pidFile = path; | 342 | m_pidFile = path; |