mirror of
https://github.com/krystalgamer/spidey-decomp.git
synced 2024-11-23 13:29:48 +00:00
Utils_CompareString now matches without goto
This commit is contained in:
parent
c10e198c49
commit
73948e63ee
15
utils.cpp
15
utils.cpp
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user