removed redundant insert and added a missing define on mac os x
This commit is contained in:
parent
9844652e6b
commit
8eac14158b
2 changed files with 3 additions and 12 deletions
3
compat.h
3
compat.h
|
@ -26,6 +26,9 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef u_int SOCKET;
|
typedef u_int SOCKET;
|
||||||
|
#ifdef __APPLE__
|
||||||
|
#define MSG_NOSIGNAL 0
|
||||||
|
#endif
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#define MSG_NOSIGNAL 0
|
#define MSG_NOSIGNAL 0
|
||||||
#define MSG_DONTWAIT 0
|
#define MSG_DONTWAIT 0
|
||||||
|
|
12
serialize.h
12
serialize.h
|
@ -932,18 +932,6 @@ public:
|
||||||
iterator insert(iterator it, const char& x=char()) { return vch.insert(it, x); }
|
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, 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)
|
void insert(iterator it, std::vector<char>::const_iterator first, std::vector<char>::const_iterator last)
|
||||||
{
|
{
|
||||||
if (it == vch.begin() + nReadPos && last - first <= nReadPos)
|
if (it == vch.begin() + nReadPos && last - first <= nReadPos)
|
||||||
|
|
Loading…
Reference in a new issue