Also cache the value of `childCount - footerCount` so it's not computed on every iteration.