MT#57435 self-comparison always evaluates to true (XmlRpcValue.cpp)

A mistake in the bool of the return in the XmlRpc::tmEq():

     src/XmlRpcValue.cpp: In function 'bool XmlRpc::tmEq(const tm&, const tm&)':
     src/XmlRpcValue.cpp:144:52: warning: self-comparison always evaluates to true [-Wtautological-compare]
       144 |             t1.tm_hour == t2.tm_hour && t1.tm_mday == t1.tm_mday &&
           |

Second one should be of the `t2` variable.

Change-Id: I7fbf3b1b2f9becdb14db2e994fb4d0abf0937964
mr11.4.1
Donat Zenichev 3 years ago
parent 23a917d5ad
commit b9196fa647

@ -141,7 +141,7 @@ namespace XmlRpc {
// Predicate for tm equality
static bool tmEq(struct tm const& t1, struct tm const& t2) {
return t1.tm_sec == t2.tm_sec && t1.tm_min == t2.tm_min &&
t1.tm_hour == t2.tm_hour && t1.tm_mday == t1.tm_mday &&
t1.tm_hour == t2.tm_hour && t1.tm_mday == t2.tm_mday &&
t1.tm_mon == t2.tm_mon && t1.tm_year == t2.tm_year;
}

Loading…
Cancel
Save