From 8eac14158b71bb6de3035705a6182cb13a2d7c75 Mon Sep 17 00:00:00 2001 From: Erik Mossberg Date: Mon, 24 Mar 2014 22:17:43 +0100 Subject: [PATCH] removed redundant insert and added a missing define on mac os x --- compat.h | 3 +++ serialize.h | 12 ------------ 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/compat.h b/compat.h index 79ebb93..2461ff4 100644 --- a/compat.h +++ b/compat.h @@ -26,6 +26,9 @@ #endif typedef u_int SOCKET; +#ifdef __APPLE__ +#define MSG_NOSIGNAL 0 +#endif #ifdef WIN32 #define MSG_NOSIGNAL 0 #define MSG_DONTWAIT 0 diff --git a/serialize.h b/serialize.h index d3f6b7d..4e677c3 100644 --- a/serialize.h +++ b/serialize.h @@ -932,18 +932,6 @@ public: iterator insert(iterator it, const char& x=char()) { return vch.insert(it, x); } void insert(iterator it, size_type n, const char& x) { vch.insert(it, n, x); } - void insert(iterator it, const_iterator first, const_iterator last) - { - if (it == vch.begin() + nReadPos && last - first <= nReadPos) - { - // special case for inserting at the front when there's room - nReadPos -= (last - first); - memcpy(&vch[nReadPos], &first[0], last - first); - } - else - vch.insert(it, first, last); - } - void insert(iterator it, std::vector::const_iterator first, std::vector::const_iterator last) { if (it == vch.begin() + nReadPos && last - first <= nReadPos)