summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/BasicStream.cpp
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2005-02-21 15:11:21 +0000
committerDwayne Boone <dwayne@zeroc.com>2005-02-21 15:11:21 +0000
commitbdc6a4365d3c063100d24ef2a48e8f9c1ff14ce0 (patch)
tree2b8ad26e1451b440432bd6fe4b2a55d019d1c674 /cpp/src/Ice/BasicStream.cpp
parentfix bogus tar typo (diff)
downloadice-bdc6a4365d3c063100d24ef2a48e8f9c1ff14ce0.tar.bz2
ice-bdc6a4365d3c063100d24ef2a48e8f9c1ff14ce0.tar.xz
ice-bdc6a4365d3c063100d24ef2a48e8f9c1ff14ce0.zip
Removed bogus optimization from read(vector<string>)
Diffstat (limited to 'cpp/src/Ice/BasicStream.cpp')
-rw-r--r--cpp/src/Ice/BasicStream.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/cpp/src/Ice/BasicStream.cpp b/cpp/src/Ice/BasicStream.cpp
index 89de4667324..96a8812b402 100644
--- a/cpp/src/Ice/BasicStream.cpp
+++ b/cpp/src/Ice/BasicStream.cpp
@@ -1371,18 +1371,14 @@ IceInternal::BasicStream::read(vector<string>& v)
startSeq(sz, 1);
v.clear();
- //
- // For efficiency, we use reserve() here to avoid having the
- // vector reallocate repeatedly.
- //
- v.reserve(sz);
+ v.resize(sz);
for(int i = 0; i < sz; ++i)
{
- v.resize(i + 1);
- read(v.back());
+ read(v[i]);
checkSeq();
endElement();
}
+
endSeq(sz);
}