Bug 36277: Improve algorithmic complexity of batch_add
The 2 nested loops are terrible in term of algorithmic complexity.
Especially if we are fetching from there.
The goal of this patch is to fetch all the limits outside of the loop.
If you have 100 libraries, it will remove 100^2 - 1 fetches!
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit
202628342ab9397e8b15aa5e62c0aaa041d3c8a0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>