fix repetition code again
- bug spotted by Sven Schule (sp-i cound be outside bounds when starting from a FEN with a large enough 50 counter)
- speed optimization proposed by Richard Vida (avoid calculating the condition if the keys don't match)

No functional change.
signature = 6727896