Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Taudul <wolf.pld@gmail.com>2019-02-12 20:45:51 +0300
committerBartosz Taudul <wolf.pld@gmail.com>2019-02-13 00:11:15 +0300
commitec37f59c149ae6f8f5d6c071842aae95a98c24c4 (patch)
tree6e80c55ab390759e78ceac507d2aee598e0ad736 /server/TracyVarArray.hpp
parente4e20b47cabbebc14c9147045f94fcd9f9ed5491 (diff)
Replace manual comparison with memcmp.
Diffstat (limited to 'server/TracyVarArray.hpp')
-rw-r--r--server/TracyVarArray.hpp8
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>