mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
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.
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Microsoft.CSharp;
|
||||
using OpenSim.Region.ScriptEngine.Shared.CodeTools;
|
||||
using System.CodeDom.Compiler;
|
||||
@@ -201,12 +202,8 @@ namespace OpenSim.Tools.LSL.Compiler
|
||||
// Convert to base64
|
||||
//
|
||||
string filetext = System.Convert.ToBase64String(data);
|
||||
|
||||
System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
|
||||
|
||||
Byte[] buf = enc.GetBytes(filetext);
|
||||
|
||||
FileStream sfs = File.Create(OutFile+".text");
|
||||
Byte[] buf = Encoding.ASCII.GetBytes(filetext);
|
||||
FileStream sfs = File.Create(OutFile + ".text");
|
||||
sfs.Write(buf, 0, buf.Length);
|
||||
sfs.Close();
|
||||
|
||||
@@ -222,9 +219,9 @@ namespace OpenSim.Tools.LSL.Compiler
|
||||
// }
|
||||
// }
|
||||
|
||||
buf = enc.GetBytes(posmap);
|
||||
buf = Encoding.ASCII.GetBytes(posmap);
|
||||
|
||||
FileStream mfs = File.Create(OutFile+".map");
|
||||
FileStream mfs = File.Create(OutFile + ".map");
|
||||
mfs.Write(buf, 0, buf.Length);
|
||||
mfs.Close();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user