mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 18:25:33 +08:00
cosmetic
This commit is contained in:
@@ -96,9 +96,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
{
|
||||
lock(m_CompileLock)
|
||||
{
|
||||
ScriptObjCode objCode;
|
||||
|
||||
if(m_CompiledScriptObjCode.TryGetValue(m_ScriptObjCodeKey, out objCode) &&
|
||||
if(m_CompiledScriptObjCode.TryGetValue(m_ScriptObjCodeKey, out ScriptObjCode objCode) &&
|
||||
(objCode == m_ObjCode) &&
|
||||
(--objCode.refCount == 0))
|
||||
{
|
||||
@@ -147,7 +145,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
{
|
||||
if(flagFull)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
StringBuilder sb = new();
|
||||
sb.AppendLine(m_DescName);
|
||||
sb.AppendLine(" m_LocalID = " + m_LocalID);
|
||||
sb.AppendLine(" m_ItemID = " + m_ItemID + " (.state file)");
|
||||
@@ -247,8 +245,8 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
// Get new path, ie, files split up based on first 2 chars of name.
|
||||
// string subdir = filename.Substring (0, 2);
|
||||
// filename = filename.Substring (2);
|
||||
string subdir = filename.Substring(0, 1);
|
||||
filename = filename.Substring(1);
|
||||
string subdir = filename[..1];
|
||||
filename = filename[1..];
|
||||
scriptBasePath = Path.Combine(scriptBasePath, subdir);
|
||||
Directory.CreateDirectory(scriptBasePath);
|
||||
string newPath = Path.Combine(scriptBasePath, filename);
|
||||
@@ -426,9 +424,9 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
*/
|
||||
public static int ListInt(object element)
|
||||
{
|
||||
if(element is LSL_Integer)
|
||||
if(element is LSL_Integer linteger)
|
||||
{
|
||||
return (int)(LSL_Integer)element;
|
||||
return (int)linteger;
|
||||
}
|
||||
return (int)element;
|
||||
}
|
||||
@@ -438,9 +436,9 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
*/
|
||||
public static string ListStr(object element)
|
||||
{
|
||||
if(element is LSL_String)
|
||||
if(element is LSL_String ls)
|
||||
{
|
||||
return (string)(LSL_String)element;
|
||||
return ls.m_string;
|
||||
}
|
||||
return (string)element;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user