Skip to content

Commit

Permalink
Merge pull request #1704 from STEllAR-GROUP/speeding_up_vector_deseri…
Browse files Browse the repository at this point in the history
…alization

vector deserialization is speeded up a little
  • Loading branch information
hkaiser committed Aug 6, 2015
2 parents 2561817 + 1de8166 commit 6516a1b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions hpx/runtime/serialization/vector.hpp
Expand Up @@ -23,13 +23,11 @@ namespace hpx { namespace serialization
ar >> size; //-V128
if(size == 0) return;

vs.reserve(size);
vs.resize(size);
typedef typename std::vector<T>::value_type value_type;
for(size_type i = 0; i != size; ++i)
{
value_type v;
ar >> v;
vs.push_back(std::move(v));
ar >> vs[i];
}
}

Expand Down Expand Up @@ -91,7 +89,7 @@ namespace hpx { namespace serialization
{
// normal save ...
typedef typename std::vector<T>::value_type value_type;
for(value_type & v : vs)
for(const value_type & v : vs)
{
ar << v;
}
Expand Down

0 comments on commit 6516a1b

Please sign in to comment.