CLN: remove vestigial count code

This should close #6092.  There was some buggy code but it was never being called, and this removes it.