Allow implicit conversion from Ref<T> to T&
https://bugs.webkit.org/show_bug.cgi?id=138331
Reviewed by Andreas Kling.
Source/WebCore:
Remove unnecessary calls to Ref<T>::get() now that a Ref<T> can be
converted implicitly to a T&.
No new tests, no behavior change.
Source/WebKit2:
Remove unnecessary calls to Ref<T>::get() now that a Ref<T> can be
converted implicitly to a T&.
Source/WTF:
Allow implicit conversion from Ref<T> to T& to reduce the amount of
Ref<>::get() calls in the code and increase readability. Unlike for
RefPtr, doing this for Ref should not be error prone.
* wtf/Ref.h:
(WTF::Ref::operator T&):
(WTF::Ref::operator const T&):
* wtf/RunLoop.cpp:
(WTF::RunLoop::Holder::runLoop):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175513 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/dom/ChildListMutationScope.cpp b/Source/WebCore/dom/ChildListMutationScope.cpp
index 9b16c6b..cb5c2b0 100644
--- a/Source/WebCore/dom/ChildListMutationScope.cpp
+++ b/Source/WebCore/dom/ChildListMutationScope.cpp
@@ -85,7 +85,7 @@
Ref<Node> child(childRef);
- if (!isAddedNodeInOrder(child.get()))
+ if (!isAddedNodeInOrder(child))
enqueueMutationRecord();
if (isEmpty()) {
@@ -108,7 +108,7 @@
Ref<Node> child(childRef);
- if (!m_addedNodes.isEmpty() || !isRemovedNodeInOrder(child.get()))
+ if (!m_addedNodes.isEmpty() || !isRemovedNodeInOrder(child))
enqueueMutationRecord();
if (isEmpty()) {
@@ -128,7 +128,7 @@
RefPtr<NodeList> addedNodes = StaticNodeList::adopt(m_addedNodes);
RefPtr<NodeList> removedNodes = StaticNodeList::adopt(m_removedNodes);
- RefPtr<MutationRecord> record = MutationRecord::createChildList(m_target.get(), addedNodes.release(), removedNodes.release(), m_previousSibling.release(), m_nextSibling.release());
+ RefPtr<MutationRecord> record = MutationRecord::createChildList(m_target, addedNodes.release(), removedNodes.release(), m_previousSibling.release(), m_nextSibling.release());
m_observers->enqueueMutationRecord(record.release());
m_lastAdded = 0;
ASSERT(isEmpty());