diff options
author | Bartosz Taudul <wolf.pld@gmail.com> | 2019-02-12 20:45:51 +0300 |
---|---|---|
committer | Bartosz Taudul <wolf.pld@gmail.com> | 2019-02-13 00:11:15 +0300 |
commit | ec37f59c149ae6f8f5d6c071842aae95a98c24c4 (patch) | |
tree | 6e80c55ab390759e78ceac507d2aee598e0ad736 /server/TracyVarArray.hpp | |
parent | e4e20b47cabbebc14c9147045f94fcd9f9ed5491 (diff) |
Replace manual comparison with memcmp.
Diffstat (limited to 'server/TracyVarArray.hpp')
-rw-r--r-- | server/TracyVarArray.hpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/server/TracyVarArray.hpp b/server/TracyVarArray.hpp index 938a9b16..d63a9772 100644 --- a/server/TracyVarArray.hpp +++ b/server/TracyVarArray.hpp @@ -2,6 +2,7 @@ #define __TRACYVARARRAY_HPP__ #include <stdint.h> +#include <string.h> #include "../common/TracyForceInline.hpp" #include "tracy_flat_hash_map.hpp" @@ -60,12 +61,7 @@ template<typename T> bool Compare( const VarArray<T>& lhs, const VarArray<T>& rhs ) { if( lhs.size() != rhs.size() || lhs.get_hash() != rhs.get_hash() ) return false; - const auto sz = lhs.size(); - for( uint8_t i=0; i<sz; i++ ) - { - if( lhs[i] != rhs[i] ) return false; - } - return true; + return memcmp( lhs.data(), rhs.data(), lhs.size() * sizeof( T ) ) == 0; } template<typename T> |