Index: third_party/WebKit/Source/core/animation/InterpolableValue.h |
diff --git a/third_party/WebKit/Source/core/animation/InterpolableValue.h b/third_party/WebKit/Source/core/animation/InterpolableValue.h |
index 1c214ed04e9e451d42b017c756e3e8225a68c814..97944a0c930800711520481801be1202f8306a15 100644 |
--- a/third_party/WebKit/Source/core/animation/InterpolableValue.h |
+++ b/third_party/WebKit/Source/core/animation/InterpolableValue.h |
@@ -122,20 +122,17 @@ public: |
bool isList() const final { return true; } |
void set(size_t position, std::unique_ptr<InterpolableValue> value) |
{ |
- DCHECK_LT(position, m_size); |
m_values[position] = std::move(value); |
} |
const InterpolableValue* get(size_t position) const |
{ |
- DCHECK_LT(position, m_size); |
return m_values[position].get(); |
} |
std::unique_ptr<InterpolableValue>& getMutable(size_t position) |
{ |
- DCHECK_LT(position, m_size); |
alancutter (OOO until 2018)
2016/08/25 02:03:53
These checks are already performed by Vector::at()
|
return m_values[position]; |
} |
- size_t length() const { return m_size; } |
+ size_t length() const { return m_values.size(); } |
bool equals(const InterpolableValue& other) const final; |
std::unique_ptr<InterpolableValue> clone() const final { return create(*this); } |
std::unique_ptr<InterpolableValue> cloneAndZero() const final; |
@@ -145,20 +142,17 @@ public: |
private: |
void interpolate(const InterpolableValue& to, const double progress, InterpolableValue& result) const final; |
explicit InterpolableList(size_t size) |
- : m_size(size) |
- , m_values(m_size) |
+ : m_values(size) |
{ |
} |
InterpolableList(const InterpolableList& other) |
- : m_size(other.m_size) |
- , m_values(m_size) |
+ : m_values(other.length()) |
{ |
- for (size_t i = 0; i < m_size; i++) |
+ for (size_t i = 0; i < length(); i++) |
set(i, other.m_values[i]->clone()); |
} |
- size_t m_size; |
Vector<std::unique_ptr<InterpolableValue>> m_values; |
}; |