mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 03:28:20 +02:00
EnumParser signed fix
This commit is contained in:
parent
dfd7a13066
commit
d76cc1ebc9
1 changed files with 3 additions and 3 deletions
|
@ -485,7 +485,7 @@ namespace System
|
|||
{
|
||||
var fieldInfo = caseList[caseIdx];
|
||||
var fieldName = GetFieldName(fieldInfo, .. scope .(64));
|
||||
int hashCode = fieldName.GetHashCode();
|
||||
int hashCode = fieldName.GetHashCode() & Int.MaxValue;
|
||||
if (buckets.TryAdd(hashCode % numBuckets, ?, var entryList))
|
||||
*entryList = default;
|
||||
entryList.Add((hashCode, caseIdx));
|
||||
|
@ -500,12 +500,12 @@ namespace System
|
|||
if (hasPayload)
|
||||
strName = (ignoreCasePass == 0) ? "checkStr" : "nameStr";
|
||||
else
|
||||
strName = "str";
|
||||
strName = (ignoreCasePass == 0) ? "checkStr" : "str";
|
||||
if (ignoreCasePass == 0)
|
||||
code.AppendF($"\t\tString checkStr = scope .({(hasPayload ? "nameStr" : "str")})..ToLower();\n");
|
||||
code.AppendF($"\t\tint hashCode = {strName}.GetHashCode();\n");
|
||||
if (numBuckets > 1)
|
||||
code.AppendF($"\t\tswitch (hashCode % {numBuckets})\n");
|
||||
code.AppendF($"\t\tswitch ((hashCode & Int.MaxValue) % {numBuckets})\n");
|
||||
code.Append("\t\t{\n");
|
||||
for (int bucketIdx < numBuckets)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue