[PATCH v2 2/3] pacdiff: Reduce repetition in input loop