Title: [108463] trunk/Source/WebCore
Revision
108463
Author
[email protected]
Date
2012-02-22 01:28:57 -0800 (Wed, 22 Feb 2012)

Log Message

[gtk] Accessibility: use find funtion in vector instead of for.
https://bugs.webkit.org/show_bug.cgi?id=77878

Patch by Frederik Gladhorn <[email protected]> on 2012-02-22
Reviewed by Hajime Morita.

Minor cleanup, use the find function from vector.

* accessibility/gtk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetIndexInParent):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (108462 => 108463)


--- trunk/Source/WebCore/ChangeLog	2012-02-22 09:14:53 UTC (rev 108462)
+++ trunk/Source/WebCore/ChangeLog	2012-02-22 09:28:57 UTC (rev 108463)
@@ -1,3 +1,15 @@
+2012-02-22  Frederik Gladhorn  <[email protected]>
+
+        [gtk] Accessibility: use find funtion in vector instead of for.
+        https://bugs.webkit.org/show_bug.cgi?id=77878
+
+        Reviewed by Hajime Morita.
+
+        Minor cleanup, use the find function from vector.
+
+        * accessibility/gtk/WebKitAccessibleWrapperAtk.cpp:
+        (webkitAccessibleGetIndexInParent):
+
 2012-02-22  Ryosuke Niwa  <[email protected]>
 
         Remove the remaining uses of CSSStyleDeclaration in Editor

Modified: trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleWrapperAtk.cpp (108462 => 108463)


--- trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleWrapperAtk.cpp	2012-02-22 09:14:53 UTC (rev 108462)
+++ trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleWrapperAtk.cpp	2012-02-22 09:28:57 UTC (rev 108463)
@@ -396,14 +396,8 @@
     if (parent && parent->isTableRow() && coreObject->isTableCell())
         return getIndexInParentForCellInRow(coreObject);
 
-    AccessibilityObject::AccessibilityChildrenVector children = parent->children();
-    unsigned count = children.size();
-    for (unsigned i = 0; i < count; ++i) {
-        if (children[i] == coreObject)
-            return i;
-    }
-
-    return -1;
+    size_t index = parent->children().find(coreObject);
+    return (index == WTF::notFound) ? -1 : index;
 }
 
 static AtkAttributeSet* webkitAccessibleGetAttributes(AtkObject* object)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to