Commit 8792a1cb authored by Fredrik Söderquist's avatar Fredrik Söderquist Committed by Commit Bot

Remove dead code in SVGListPropertyHelper<...>::ReplaceItem

If |values_| does not contain any entries, then CheckIndexBound will
fail, so the 'values_.IsEmpty()' condition can never be true here.

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I3c96b6b198a8d9f345a08a436101d803384d11e2
Reviewed-on: https://chromium-review.googlesource.com/1179834Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#584174}
parent 538d34d3
......@@ -224,17 +224,6 @@ ItemProperty* SVGListPropertyHelper<Derived, ItemProperty>::ReplaceItem(
if (!CheckIndexBound(index, exception_state))
return nullptr;
if (values_.IsEmpty()) {
// 'newItem' already lived in our list, we removed it, and now we're empty,
// which means there's nothing to replace.
// TODO(fs): This should not cause us to throw an exception.
exception_state.ThrowDOMException(
DOMExceptionCode::kIndexSizeError,
String::Format("Failed to replace the provided item at index %zu.",
static_cast<size_t>(index)));
return nullptr;
}
// Update the value at the desired position 'index'.
Member<ItemPropertyType>& position = values_[index];
DCHECK_EQ(position->OwnerList(), this);
......
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