Summary: | [Texmap] Remove duplicated code in TextureMapperLayer | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Jae Hyun Park <jaepark> | ||||||
Component: | Layout and Rendering | Assignee: | Jae Hyun Park <jaepark> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | cmarcelo, commit-queue, kondapallykalyan, luiz, mrobinson, noam, svillar, webkit-ews | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Jae Hyun Park
2014-03-12 19:45:24 PDT
Created attachment 226568 [details]
Patch
Comment on attachment 226568 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=226568&action=review > Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp:496 > - if (m_parent) { > - unsigned i; > - for (i = 0; i < m_parent->m_children.size(); i++) { > - if (this == m_parent->m_children[i]) { > - m_parent->m_children.remove(i); > - break; > - } > - } > + if (m_parent) > + m_parent->m_children.remove(m_parent->m_children.find(this)); The removed code is slightly different in that it gracefully handles the situation where m_parent->m_children doesn't contain "this." Do you know if that's important? (In reply to comment #2) > (From update of attachment 226568 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=226568&action=review > > > Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp:496 > > - if (m_parent) { > > - unsigned i; > > - for (i = 0; i < m_parent->m_children.size(); i++) { > > - if (this == m_parent->m_children[i]) { > > - m_parent->m_children.remove(i); > > - break; > > - } > > - } > > + if (m_parent) > > + m_parent->m_children.remove(m_parent->m_children.find(this)); > > The removed code is slightly different in that it gracefully handles the situation where m_parent->m_children doesn't contain "this." Do you know if that's important? I can't think of a case where m_parent exists but m_parent->children doesn't contain "this". Do you happen to know how that might happen? (In reply to comment #3) > I can't think of a case where m_parent exists but m_parent->children doesn't contain "this". Do you happen to know how that might happen? I'm not sure. (In reply to comment #4) > (In reply to comment #3) > > > I can't think of a case where m_parent exists but m_parent->children doesn't contain "this". Do you happen to know how that might happen? > > I'm not sure. Then we could try with an ASSERT() and check if it's hit. Created attachment 226634 [details]
Patch
Comment on attachment 226634 [details] Patch Clearing flags on attachment: 226634 Committed r165665: <http://trac.webkit.org/changeset/165665> All reviewed patches have been landed. Closing bug. |