From f50488a36188d5975bfa8554687a1acdd394d6a9 Mon Sep 17 00:00:00 2001 From: Thaer Razeq Date: Thu, 23 Feb 2017 02:28:09 -0600 Subject: Various fixes detected using PVS-Studio static analyzer. - Add FIXME tags comments to some unfixed potential bugs - Remove some checks (always false: unsigned never < 0) - Fix some if statements based on reviews. - Bunch of missing `else` statements --- core/variant.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/variant.cpp') diff --git a/core/variant.cpp b/core/variant.cpp index 132d7a1c8..f45c3fd55 100644 --- a/core/variant.cpp +++ b/core/variant.cpp @@ -2953,7 +2953,7 @@ uint32_t Variant::hash() const { PoolVector::Read rr = r.read(); \ \ for(int i = 0; i < l.size(); ++i) { \ - if(! p_compare_func((lr[0]), (rr[0]))) \ + if(! p_compare_func((lr[i]), (rr[i]))) \ return false; \ }\ \ @@ -3065,7 +3065,7 @@ bool Variant::hash_compare(const Variant& p_variant) const { return false; for(int i = 0; i < l.size(); ++i) { - if(! l[0].hash_compare(r[0])) + if(! l[i].hash_compare(r[i])) return false; } -- cgit v1.2.3-70-g09d2