forked from Mirrors/openclonk
C4ValueArraySortStringscomp: silenced string-to-bool-conversion warning
VisualStudio gave a "performance warning" about this implicit cast. I actually don't know why, but this change makes the intention clearer anyway (since we are not returning the string contents but just whether they exist). So it's probably not bad regardless of whether the warning is weird. http://stackoverflow.com/questions/1847860/why-is-there-a-performance-warning-on-cast-pointer-to-boolliquid_container
parent
48ccc5f983
commit
4c6d347c4d
|
@ -104,7 +104,7 @@ struct C4ValueArraySortStringscomp
|
|||
{
|
||||
if (v1.getStr() && v2.getStr())
|
||||
return std::strcmp(v1._getStr()->GetCStr(), v2._getStr()->GetCStr()) < 0;
|
||||
return v2.getStr();
|
||||
return v2.getStr() != nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue