Remove some `goto`s that were added to work around #9692 (poor code
layout for loop exit paths) -- the JIT's layout decisions were improved
in #13314, and these particular `goto`s are no longer needed; crossgen
of System.Private.CoreLib now produces the same machine code with or
without this change.
Part of #13466.
//Return the (case-insensitive) difference between them.
if (charA != charB)
- goto ReturnCharAMinusCharB; // TODO: Workaround for https://github.com/dotnet/coreclr/issues/9692
+ return charA - charB;
// Next char
a++; b++;
}
return strA.Length - strB.Length;
-
- ReturnCharAMinusCharB:
- return charA - charB;
}
}
}
else
{
- goto ReturnFalse;
+ return false;
}
}
return true;
-
- ReturnFalse:
- return false;
}
}
char c = *pCh;
if (c == value1 || c == value2)
- goto ReturnIndex;
+ return (int)(pCh - pChars);
// Possibly reads outside of count and can include null terminator
// Handled in the return logic
c = *(pCh + 1);
if (c == value1 || c == value2)
- goto ReturnIndex1;
+ return (count == 1 ? -1 : (int)(pCh - pChars) + 1);
pCh += 2;
count -= 2;
}
return -1;
-
- ReturnIndex:
- return (int)(pCh - pChars);
-
- ReturnIndex1:
- return (count == 1 ? -1 : (int)(pCh - pChars) + 1);
}
}
char c = *pCh;
if (c == value1 || c == value2 || c == value3)
- goto ReturnIndex;
+ return (int)(pCh - pChars);
pCh++;
count--;
}
return -1;
-
- ReturnIndex:
- return (int)(pCh - pChars);
}
}