mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +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 fieldInfo = caseList[caseIdx];
|
||||||
var fieldName = GetFieldName(fieldInfo, .. scope .(64));
|
var fieldName = GetFieldName(fieldInfo, .. scope .(64));
|
||||||
int hashCode = fieldName.GetHashCode();
|
int hashCode = fieldName.GetHashCode() & Int.MaxValue;
|
||||||
if (buckets.TryAdd(hashCode % numBuckets, ?, var entryList))
|
if (buckets.TryAdd(hashCode % numBuckets, ?, var entryList))
|
||||||
*entryList = default;
|
*entryList = default;
|
||||||
entryList.Add((hashCode, caseIdx));
|
entryList.Add((hashCode, caseIdx));
|
||||||
|
@ -500,12 +500,12 @@ namespace System
|
||||||
if (hasPayload)
|
if (hasPayload)
|
||||||
strName = (ignoreCasePass == 0) ? "checkStr" : "nameStr";
|
strName = (ignoreCasePass == 0) ? "checkStr" : "nameStr";
|
||||||
else
|
else
|
||||||
strName = "str";
|
strName = (ignoreCasePass == 0) ? "checkStr" : "str";
|
||||||
if (ignoreCasePass == 0)
|
if (ignoreCasePass == 0)
|
||||||
code.AppendF($"\t\tString checkStr = scope .({(hasPayload ? "nameStr" : "str")})..ToLower();\n");
|
code.AppendF($"\t\tString checkStr = scope .({(hasPayload ? "nameStr" : "str")})..ToLower();\n");
|
||||||
code.AppendF($"\t\tint hashCode = {strName}.GetHashCode();\n");
|
code.AppendF($"\t\tint hashCode = {strName}.GetHashCode();\n");
|
||||||
if (numBuckets > 1)
|
if (numBuckets > 1)
|
||||||
code.AppendF($"\t\tswitch (hashCode % {numBuckets})\n");
|
code.AppendF($"\t\tswitch ((hashCode & Int.MaxValue) % {numBuckets})\n");
|
||||||
code.Append("\t\t{\n");
|
code.Append("\t\t{\n");
|
||||||
for (int bucketIdx < numBuckets)
|
for (int bucketIdx < numBuckets)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue