]> git.koha-community.org Git - koha.git/commit
Bug 31455: (QA follow-up) Make table creation O(N)
authorJoonas Kylmälä <joonas.kylmala@iki.fi>
Thu, 1 Sep 2022 19:45:25 +0000 (19:45 +0000)
committerArthur Suzuki <arthur.suzuki@biblibre.com>
Wed, 21 Sep 2022 09:17:54 +0000 (11:17 +0200)
commitfa0665ad92ac9d69d7ffde4158870f805619c413
tree693a684d69b67e135a666cd1b3d4f325301ec331
parentd15d61dcf41c928cdc08f85ba75675e324fed998
Bug 31455: (QA follow-up) Make table creation O(N)

We can insert the indices before the main loop to a hash,
this way we don't have to look up during each loop iteration
the index from an array which in the worst case might take O(N)
thus making the total time complexity O(N^2).

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 223d9d3a99903cff3d8a3078e6921da79099375c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit b2a66cd3075b85a388272885048ba3248ce60500)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
Koha/UI/Table/Builder/Items.pm