TryGetValue() for a nice time

This commit is contained in:
cinder
2025-05-28 19:34:27 -05:00
parent 800c4ba463
commit 79ef88c255
28 changed files with 105 additions and 111 deletions

View File

@@ -214,9 +214,8 @@ namespace OpenMetaverse
throw new ApplicationException("Lock could not be acquired after " + MAX_LOCK_WAIT + "ms");
try
{
if (timedStorageIndex.ContainsKey(key))
if (timedStorageIndex.TryGetValue(key, out var tkey))
{
var tkey = timedStorageIndex[key];
var o = timedStorage[tkey];
timedStorage.Remove(tkey);
tkey.Accessed();
@@ -260,9 +259,8 @@ namespace OpenMetaverse
throw new ApplicationException("Lock could not be acquired after " + MAX_LOCK_WAIT + "ms");
try
{
if (timedStorageIndex.ContainsKey(key))
if (timedStorageIndex.TryGetValue(key, out var tkey))
{
var tkey = timedStorageIndex[key];
o = timedStorage[tkey];
timedStorage.Remove(tkey);
tkey.Accessed();