mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-12-24 01:09:23 +01:00
Fixed DynamicEnum AddFlag going into an infinite loop
This commit is contained in:
parent
1bbb12a1fa
commit
81dcbfb9a1
2 changed files with 4 additions and 1 deletions
|
@ -51,6 +51,9 @@ Improvements
|
|||
- Improved CopyExtensions construction speed
|
||||
- Improved DynamicEnum caching
|
||||
|
||||
Fixes
|
||||
- Fixed DynamicEnum AddFlag going into an infinite loop
|
||||
|
||||
## 5.0.0
|
||||
### MLEM
|
||||
Additions
|
||||
|
|
|
@ -148,7 +148,7 @@ namespace MLEM.Data {
|
|||
public static T AddFlag<T>(string name) where T : DynamicEnum {
|
||||
BigInteger value = 0;
|
||||
while (GetStorage(typeof(T)).Values.ContainsKey(value))
|
||||
value <<= 1;
|
||||
value = value != 0 ? value << 1 : 1;
|
||||
return Add<T>(name, value);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue