This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository efl.

View the commit online.

commit e2dcf4687555032b685c35929fafafaee768966b
Author: Cedric BAIL <[email protected]>
AuthorDate: Mon Nov 9 17:18:08 2026 -0600

    elementary: collection view reads the model count once per request
    
    A request is trimmed to the model's count with two comparisons and a
    subtraction, each asking the model again. They must see one number or
    the unsigned subtraction wraps to a request for four billion rows. Ask
    once. The count cannot change under this single-threaded code with the
    models of EFL, so there is no test that can reach it.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
 src/lib/elementary/efl_ui_collection_view.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/lib/elementary/efl_ui_collection_view.c b/src/lib/elementary/efl_ui_collection_view.c
index 9b48f0273e..32b1553ca9 100644
--- a/src/lib/elementary/efl_ui_collection_view.c
+++ b/src/lib/elementary/efl_ui_collection_view.c
@@ -918,6 +918,7 @@ _batch_request_flush(Eina_List *requests,
         // Check request intersection with all pending request
         Efl_Ui_Collection_Request *inflight;
         Efl_Model *model;
+        unsigned int count;
         Eina_List *l;
 
         EINA_LIST_FOREACH(pd->requests, l, inflight)
@@ -994,17 +995,19 @@ _batch_request_flush(Eina_List *requests,
              free(request);
              continue;
           }
+        // Asked once: the two checks below and the subtraction must see the same count
+        count = efl_model_children_count_get(model);
         // Is the request inside the limit of the model?
-        if (request->offset >= efl_model_children_count_get(model))
+        if (request->offset >= count)
           {
              requests = eina_list_remove_list(requests, ll);
              free(request);
              continue;
           }
         // Is its limit outside the model limit?
-        if (request->offset + request->length >= efl_model_children_count_get(model))
+        if (request->offset + request->length >= count)
           {
-             request->length = efl_model_children_count_get(model) - request->offset;
+             request->length = count - request->offset;
           }
 
         // We now have a request, time to trigger a fetch

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to