(maint) Remove unused index in iteration

This replaces a each_with_index with just each since the index
was not used in the logic of the internal_check_no_capture method
in the checker4.0.