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-bool
liquid_container
David Dormagen 2016-02-27 11:38:59 +01:00
parent 48ccc5f983
commit 4c6d347c4d
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}
};