removed redundant insert and added a missing define on mac os x

This commit is contained in:
Erik Mossberg 2014-03-24 22:17:43 +01:00
parent 9844652e6b
commit 8eac14158b
2 changed files with 3 additions and 12 deletions

View File

@ -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

View File

@ -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<char>::const_iterator first, std::vector<char>::const_iterator last)
{
if (it == vch.begin() + nReadPos && last - first <= nReadPos)