mediawiki-extensions-Cite/tests/qunit
thiemowmde c921c76dd2 Consolidate duplicate "is reference list empty" code paths
Introduce a static method so we don't need to copy paste code.

Note that the static method still largely duplicates what the method
.buildIndex() will later do. Both loops iterate the reference groups
and the references in each group. The main difference is that the
"is empty" check stops extremely early the moment it finds any
non-empty group.

That's also why I'm convinced it's not worth caching the result.
I benchmarked it and it's nanoseconds. But there are more reasons:

The non-static .isIndexEmpty() method is currently only used when
Citoid is active the same time. Which means the cached result was
entirely unused on installations without Citoid.

Bug: T356871
Change-Id: Id5c4295086bc977ef52ad141be9962d2eecb1bcc
2024-05-07 15:51:12 +02:00
..
ext.cite.referencePreviews Add ReferencePreviews config checks to Cite extension 2024-04-25 12:50:27 +02:00
ve-cite Consolidate duplicate "is reference list empty" code paths 2024-05-07 15:51:12 +02:00
.eslintrc.json Move reference previews to Cite extension 2024-03-12 17:43:51 +01:00