fix: Eliminates double lookup with Contains->Remove (#2539)
This commit is contained in:
parent
e12cc5dd83
commit
8d88ef70fd
12 changed files with 25 additions and 80 deletions
|
|
@ -2642,10 +2642,8 @@ namespace Server.Multis
|
|||
return;
|
||||
}
|
||||
|
||||
if (Access.Contains(targ))
|
||||
if (Access.Remove(targ))
|
||||
{
|
||||
Access.Remove(targ);
|
||||
|
||||
if (!HasAccess(targ) && IsInside(targ))
|
||||
{
|
||||
targ.Location = BanLocation;
|
||||
|
|
@ -2800,10 +2798,8 @@ namespace Server.Multis
|
|||
return;
|
||||
}
|
||||
|
||||
if (CoOwners.Contains(targ))
|
||||
if (CoOwners.Remove(targ))
|
||||
{
|
||||
CoOwners.Remove(targ);
|
||||
|
||||
targ.Delta(MobileDelta.Noto);
|
||||
|
||||
from.SendLocalizedMessage(501299); // Co-owner removed from list.
|
||||
|
|
@ -2872,10 +2868,8 @@ namespace Server.Multis
|
|||
return;
|
||||
}
|
||||
|
||||
if (Friends.Contains(targ))
|
||||
if (Friends.Remove(targ))
|
||||
{
|
||||
Friends.Remove(targ);
|
||||
|
||||
targ.Delta(MobileDelta.Noto);
|
||||
|
||||
from.SendLocalizedMessage(501298); // Friend removed from list.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue