Browse Source

Merge pull request #3162 from sipa/saninsert

Remove redundant insert method in serialize
0.10
Wladimir J. van der Laan 11 years ago
parent
commit
cde10602a6
  1. 13
      src/serialize.h

13
src/serialize.h

@ -901,19 +901,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)
{
assert(last - first >= 0);
if (it == vch.begin() + nReadPos && (unsigned int)(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)
{ {
assert(last - first >= 0); assert(last - first >= 0);

Loading…
Cancel
Save