optimize checkPairRec in mcgbcheck.lib