Commit 1c699252 authored by haraken@chromium.org's avatar haraken@chromium.org

Oilpan: Initialize the size of InterporableValue::m_values in the constructor

This is a simple follow-up CL for r170298.
We should initialize the vector in the constructor and avoid calling resize().

Review URL: https://codereview.chromium.org/216173006

git-svn-id: svn://svn.chromium.org/blink/trunk@170328 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent e44eb3bc
......@@ -116,16 +116,14 @@ private:
virtual PassOwnPtrWillBeRawPtr<InterpolableValue> interpolate(const InterpolableValue &other, const double progress) const OVERRIDE FINAL;
explicit InterpolableList(size_t size)
: m_size(size)
, m_values(m_size)
{
m_values.reserveCapacity(m_size);
m_values.resize(m_size);
}
InterpolableList(const InterpolableList& other)
: m_size(other.m_size)
, m_values(m_size)
{
m_values.reserveCapacity(m_size);
m_values.resize(m_size);
for (size_t i = 0; i < m_size; i++)
set(i, other.m_values[i]->clone());
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment