Slight code rearrangement to avoid testing getstate twice.
1 file changed