aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/utils/mem_ops.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/utils/mem_ops.h b/src/utils/mem_ops.h
index 92a130310..be617ff19 100644
--- a/src/utils/mem_ops.h
+++ b/src/utils/mem_ops.h
@@ -62,12 +62,12 @@ inline void set_mem(T* ptr, size_t n, byte val)
*/
template<typename T> inline bool same_mem(const T* p1, const T* p2, size_t n)
{
- bool is_same = true;
+ volatile T difference = 0;
for(size_t i = 0; i != n; ++i)
- is_same &= (p1[i] == p2[i]);
+ difference |= (p1[i] ^ p2[i]);
- return is_same;
+ return difference == 0;
}
}