Utils_CompareString now matches without goto

This commit is contained in:
Jose Silva 2023-04-11 19:12:46 +02:00
parent c10e198c49
commit 73948e63ee

View File

@ -53,15 +53,16 @@ int Utils_CrapXZDist(const CVector& a,const CVector& b) {
int Utils_CompareStrings(const char* left, const char* right) {
if (left == NULL){
//Without the goto the statement is simplified to a setnz/setz
// with it it jumps to the same return block as when the comparison fails
if (right != NULL)
goto fail;
if (left == NULL && right == NULL){
return 1;
}
if (left == NULL || right == NULL){
return 0;
}
if (right != NULL){
@ -98,7 +99,5 @@ int Utils_CompareStrings(const char* left, const char* right) {
}
}
fail:
return 0;
}