Skip to content

Commit 5151b4a

Browse files
committed
imprved performance of GetPluginUniqueID() in BasePlugin Study
1 parent ed4d460 commit 5151b4a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

VisualHFT.Commons/PluginManager/BasePluginStudy.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,12 @@ protected T LoadFromUserSettings<T>() where T : class
309309
return null;
310310
}
311311

312+
private string _pluginUniqueID = null;
312313
public virtual string GetPluginUniqueID()
313314
{
315+
if (_pluginUniqueID != null)
316+
return _pluginUniqueID;
317+
314318
// Get the fully qualified name of the assembly
315319
string assemblyName = GetType().Assembly.FullName;
316320

@@ -326,8 +330,9 @@ public virtual string GetPluginUniqueID()
326330
{
327331
builder.Append(bytes[i].ToString("x2"));
328332
}
329-
return builder.ToString();
333+
_pluginUniqueID = builder.ToString();
330334
}
335+
return _pluginUniqueID;
331336
}
332337
public abstract object GetUISettings(); //using object type because this csproj doesn't support UI
333338
public virtual object GetCustomUI()

0 commit comments

Comments
 (0)