[ATSPI] Stop traversing tree immediatelly after reaching the maximum size of query...
[platform/core/uifw/dali-adaptor.git] / dali / internal / accessibility / bridge / bridge-collection.cpp
index 497863b..d6caa90 100644 (file)
@@ -466,6 +466,11 @@ void BridgeCollection::VisitNodes(Accessible* obj, std::vector<Accessible*>& res
   if(comparer(obj))
   {
     result.emplace_back(obj);
+    // the code below will never return for maxCount equal 0
+    if(result.size() == maxCount)
+    {
+      return;
+    }
   }
 
   for(auto i = 0u; i < obj->GetChildCount(); ++i)