This commit partially reverts and fixes commit 6c9f59b4, removing a
speed bottleneck introduced by that commit, while keeping the fix from
that commit that should prevent not displaying the first of a series
of items displayed together with a header text.