mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 20:58:34 +01:00
don't use new caches for HasFlag and HasAnyFlag
This commit is contained in:
parent
54e3c98029
commit
05e320d4f4
1 changed files with 2 additions and 2 deletions
|
@ -59,7 +59,7 @@ namespace MLEM.Data {
|
||||||
if (this.allFlagsCache == null)
|
if (this.allFlagsCache == null)
|
||||||
this.allFlagsCache = new Dictionary<DynamicEnum, bool>();
|
this.allFlagsCache = new Dictionary<DynamicEnum, bool>();
|
||||||
if (!this.allFlagsCache.TryGetValue(flags, out var ret)) {
|
if (!this.allFlagsCache.TryGetValue(flags, out var ret)) {
|
||||||
ret = And(this, flags) == flags;
|
ret = (GetValue(this) & GetValue(flags)) == GetValue(flags);
|
||||||
this.allFlagsCache.Add(flags, ret);
|
this.allFlagsCache.Add(flags, ret);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -75,7 +75,7 @@ namespace MLEM.Data {
|
||||||
if (this.anyFlagsCache == null)
|
if (this.anyFlagsCache == null)
|
||||||
this.anyFlagsCache = new Dictionary<DynamicEnum, bool>();
|
this.anyFlagsCache = new Dictionary<DynamicEnum, bool>();
|
||||||
if (!this.anyFlagsCache.TryGetValue(flags, out var ret)) {
|
if (!this.anyFlagsCache.TryGetValue(flags, out var ret)) {
|
||||||
ret = GetValue(And(this, flags)) != 0;
|
ret = (GetValue(this) & GetValue(flags)) != 0;
|
||||||
this.anyFlagsCache.Add(flags, ret);
|
this.anyFlagsCache.Add(flags, ret);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in a new issue