Kaioru / Edelstein

A v.95.1 Mushroom game server emulator written in C# .NET
MIT License
112 stars 29 forks source link

Double look-up in dictionaries #52

Closed gilmatok closed 2 years ago

gilmatok commented 4 years ago
 public ITemplate Get(int id)
        {
            return !Templates.ContainsKey(id) ? null : Templates[id];
        }

This is a double look-up. Use "Dicitonary.TryGetValue" instead.

Kaioru commented 4 years ago

Noted, I'll look around the source code for similar issues too. Thanks so much for letting me know!

Kaioru commented 2 years ago

After 2 years and a few more reiterations, this should now be resolved.

gilmatok commented 2 years ago

@Kaioru happt to see you're still maintaining this. Good work!