mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-08-09 14:22:40 +00:00
perf[cs]: avoid duplicate initializations
This commit is contained in:
@@ -10,10 +10,16 @@ namespace zfoocs
|
||||
|
||||
private static readonly IProtocolRegistration[] protocols = new IProtocolRegistration[MAX_PROTOCOL_NUM];
|
||||
private static readonly Dictionary<Type, short> protocolIdMap = new Dictionary<Type, short>();
|
||||
private static bool initialized = false;
|
||||
|
||||
|
||||
public static void InitProtocol()
|
||||
{
|
||||
if (initialized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
initialized = true;
|
||||
{}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user