From 97769e8aaa926883961eaf3db63c38dcffd379ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=8B=D1=87=D0=BA=D0=BE=D0=B2=20=D0=90=D0=BD=D0=B4?= =?UTF-8?q?=D1=80=D0=B5=D0=B9?= Date: Thu, 27 Jun 2019 15:12:22 +0000 Subject: [PATCH] git-svn-id: svn://db.shs.com.ru/pip@823 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5 --- src_main/containers/pimap.h | 1 - src_main/core/pibase.h | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) 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);