static_pointer_cast<>() may cause some unnecessary ref-counting churn
https://bugs.webkit.org/show_bug.cgi?id=238961
Reviewed by Darin Adler.
Source/WebCore:
* dom/TreeScope.cpp:
(WebCore::TreeScope::elementFromPoint):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::textNodeForRebalance const):
* editing/DeleteSelectionCommand.cpp:
(WebCore::firstInSpecialElement):
(WebCore::lastInSpecialElement):
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter):
* page/ImageOverlayController.cpp:
(WebCore::ImageOverlayController::selectionQuadsDidChange):
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::pageDestroyed):
* page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp:
(WebCore::ScrollingCoordinatorNicosia::pageDestroyed):
Source/WTF:
* wtf/RefPtr.h:
(WTF::adoptRef):
(WTF::static_pointer_cast):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@292627 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/editing/DeleteSelectionCommand.cpp b/Source/WebCore/editing/DeleteSelectionCommand.cpp
index 37a910e..baf393f 100644
--- a/Source/WebCore/editing/DeleteSelectionCommand.cpp
+++ b/Source/WebCore/editing/DeleteSelectionCommand.cpp
@@ -111,7 +111,7 @@
VisiblePosition firstInElement = firstPositionInOrBeforeNode(node.get());
if ((isRenderedTable(node.get()) && visiblePosition == firstInElement.next()) || visiblePosition == firstInElement) {
RELEASE_ASSERT(is<HTMLElement>(node));
- return static_pointer_cast<HTMLElement>(node);
+ return static_pointer_cast<HTMLElement>(WTFMove(node));
}
}
return nullptr;
@@ -127,7 +127,7 @@
VisiblePosition lastInElement = lastPositionInOrAfterNode(node.get());
if ((isRenderedTable(node.get()) && visiblePosition == lastInElement.previous()) || visiblePosition == lastInElement) {
RELEASE_ASSERT(is<HTMLElement>(node));
- return static_pointer_cast<HTMLElement>(node);
+ return static_pointer_cast<HTMLElement>(WTFMove(node));
}
}
return nullptr;