aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers
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/Servers
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/Servers')
-rw-r--r--OpenSim/Framework/Servers/BaseOpenSimServer.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index 9459f76..14d8b0c 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -591,8 +591,8 @@ namespace OpenSim.Framework.Servers
591 { 591 {
592 string pidstring = System.Diagnostics.Process.GetCurrentProcess().Id.ToString(); 592 string pidstring = System.Diagnostics.Process.GetCurrentProcess().Id.ToString();
593 FileStream fs = File.Create(path); 593 FileStream fs = File.Create(path);
594 System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); 594
595 Byte[] buf = enc.GetBytes(pidstring); 595 Byte[] buf = Encoding.ASCII.GetBytes(pidstring);
596 fs.Write(buf, 0, buf.Length); 596 fs.Write(buf, 0, buf.Length);
597 fs.Close(); 597 fs.Close();
598 m_pidFile = path; 598 m_pidFile = path;