diff --git a/src/plugins/value/engine/partition.ml b/src/plugins/value/engine/partition.ml
index 460becf55053b5d0e646a22199255b29271eb21e..bf2a5e2b66c3893bb605cd08c9e530ecf662ead8 100644
--- a/src/plugins/value/engine/partition.ml
+++ b/src/plugins/value/engine/partition.ml
@@ -426,16 +426,8 @@ struct
           end
 
         | Branch (b,max) -> fun k _x ->
-          let list_start l i =
-            let rec aux acc i = function
-              | [] -> acc
-              | _ when i <= 0 -> List.rev acc
-              | x :: l -> aux (x :: acc) (i - 1) l
-            in
-            aux [] i l
-          in
           if max > 0 then
-            { k with branches = b :: list_start k.branches (max - 1) }
+            { k with branches = b :: Extlib.list_first_n (max - 1) k.branches  }
           else if k.branches <> [] then
             { k with branches = [] }
           else