diff --git a/src_main/containers/pimap.h b/src_main/containers/pimap.h index e680e4bd..8bdbb937 100644 --- a/src_main/containers/pimap.h +++ b/src_main/containers/pimap.h @@ -298,7 +298,6 @@ protected: found = false; return 0; } - //piCout << k << ret << found; return binarySearch(0, pim_index.size_s() - 1, k, found); } void _remove(ssize_t index) { diff --git a/src_main/core/pibase.h b/src_main/core/pibase.h index e0c2b5d8..7d0c9500 100644 --- a/src_main/core/pibase.h +++ b/src_main/core/pibase.h @@ -260,6 +260,7 @@ template inline void piSwap(T & f, T & s) {T t = f; f = s; s = t;} /*! \brief Templated function for swap two values without "=" * \details Example:\n \snippet piincludes.cpp swapBinary */ template inline void piSwapBinary(T & f, T & s) { + if ((size_t*)&f == (size_t*)&s) return; size_t j = (sizeof(T) / sizeof(size_t)), bs = j * sizeof(size_t), bf = sizeof(T); size_t i = 0; for (i = 0; i < j; ++i) { @@ -275,6 +276,7 @@ template inline void piSwapBinary(T & f, T & s) { } template<> inline void piSwapBinary(const void *& f, const void *& s) { + if ((size_t*)f == (size_t*)s) return; size_t j = (sizeof(void *) / sizeof(size_t)), bs = j * sizeof(size_t), bf = sizeof(void *); size_t i = 0; void * pf = const_cast(f), * ps = const_cast(s);