[Ada] Refactor duplicated resolution of Count and Index attributes

Attribute Index, which was added to Ada 2022 by AI12-0143, is resolved
just like attribute Count. However, code duplication rightly triggered a
CodePeer warning.

gcc/ada/

	* sem_attr.adb (Resolve_Attribute): Refactor duplicated code for
	Count and Index attributes.
1 file changed