Kevin McAvoy was one misplaced pitch away from being out of the game. Ryan Court felt he had been scuffling at the plate all month.

Both Sea Dogs made successful adjustments Thursday night that proved critical in Portland’s 2-1 Eastern League victory against the Altoona Curve at Hadlock Field that earned a split of a four-game series.

McAvoy stranded runners at second and third in the third, fourth and fifth innings, then found his groove over the final two frames to pitch a seven-inning five-hitter.

Earlier on Thursday, the Curve (68-55) won the completion of Tuesday’s game 2-1. That game, also shortened to seven innings, had been suspended in the bottom of the fourth inning because of rain. Portland (47-74) and Altoona split a doubleheader on Wednesday.

McAvoy struck out the side in the sixth, getting ahead with off-speed pitches to complement a biting two-seam fastball that handcuffed Altoona’s right-handed batters. McAvoy also worked a clean seventh to improve to 8-7 with a 5.64 ERA.

“Probably more important though was getting out of trouble and making an adjustment,” said McAvoy, a 2014 fourth-round pick. “Being able to have (pitching coach Kevin) Walker come out and calm me down and then make better pitches, in the long run that’s a bigger part.”

Walker’s visit came in the fourth after McAvoy had walked the Curve’s No. 8 and 9 batters to load the bases. He got Elvis Escobar to ground to first.

In the fifth, Altoona’s Jin-De Jhang stung an opposite-field double to left to put runners at second and third with one out. Again McAvoy escaped, helped by second baseman Tzu-Wei Lin’s good reaction to snare a sinking liner by Anderson Feliz.

Altoona starter Cody Dickson (10-5, 3.83 ERA) didn’t allow a hit until Court stroked a clean single in the fourth. Court said he consciously tried to treat his at-bats like batting practice.

“That at-bat I felt really loose and relaxed and I hit a line drive that was free and easy,” Court said.

Then on a 3-2 count in the sixth, Court flicked a hard grounder down the right field line for a two-run single.

“With one out, I was just making sure I put the ball in play,” Court said. “Helping the team is bigger than me in that situation.”

NOTES: Thursday’s announced paid attendance was 5,625. … Top Red Sox prospect Yoan Moncada sat out for a fifth straight day because of his sprained ankle. … In the completion of the suspended game Altoona’s Miguel Rosario and Portland’s Austin Maddox both pitched three perfect innings – even though Portland scored a run with Rosario on the mound. The game resumed with Altoona leading 2-0, Dubon on second base, and Rosario inheriting a 2-1 count on Court. Court drew a walk, charged to original starter Tyler Eppler. Dubon advanced to third on a wild pitch and scored on Cody Decker’s sacrifice fly.