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/Region/ScriptEngine/Shared/Api/Implementation | |
parent | Fix build break for windows with missing package for IScriptEngine in prebuil... (diff) | |
download | opensim-SC-916e3bf886ee622e2f18d6eb74f90fee8c630471.zip opensim-SC-916e3bf886ee622e2f18d6eb74f90fee8c630471.tar.gz opensim-SC-916e3bf886ee622e2f18d6eb74f90fee8c630471.tar.bz2 opensim-SC-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/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 8 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 3 |
2 files changed, 3 insertions, 8 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 0a25454..0ebcd8d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -10536,9 +10536,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10536 | return; | 10536 | return; |
10537 | } | 10537 | } |
10538 | 10538 | ||
10539 | System.Text.UTF8Encoding enc = | 10539 | string data = Encoding.UTF8.GetString(a.Data); |
10540 | new System.Text.UTF8Encoding(); | ||
10541 | string data = enc.GetString(a.Data); | ||
10542 | //m_log.Debug(data); | 10540 | //m_log.Debug(data); |
10543 | NotecardCache.Cache(id, data); | 10541 | NotecardCache.Cache(id, data); |
10544 | AsyncCommands. | 10542 | AsyncCommands. |
@@ -10591,9 +10589,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10591 | return; | 10589 | return; |
10592 | } | 10590 | } |
10593 | 10591 | ||
10594 | System.Text.UTF8Encoding enc = | 10592 | string data = Encoding.UTF8.GetString(a.Data); |
10595 | new System.Text.UTF8Encoding(); | ||
10596 | string data = enc.GetString(a.Data); | ||
10597 | //m_log.Debug(data); | 10593 | //m_log.Debug(data); |
10598 | NotecardCache.Cache(id, data); | 10594 | NotecardCache.Cache(id, data); |
10599 | AsyncCommands.DataserverPlugin.DataserverReply(id.ToString(), | 10595 | AsyncCommands.DataserverPlugin.DataserverReply(id.ToString(), |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index e90f577..cfa08c2 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -1811,8 +1811,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1811 | if (a == null) | 1811 | if (a == null) |
1812 | return UUID.Zero; | 1812 | return UUID.Zero; |
1813 | 1813 | ||
1814 | System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding(); | 1814 | string data = Encoding.UTF8.GetString(a.Data); |
1815 | string data = enc.GetString(a.Data); | ||
1816 | NotecardCache.Cache(assetID, data); | 1815 | NotecardCache.Cache(assetID, data); |
1817 | }; | 1816 | }; |
1818 | 1817 | ||