PITTSBURGH (AP) Thrust into the middle of a playoff race, J.A. Happ needed a couple of weeks to find his footing.
Consider the veteran left-hander on solid ground.
Happ allowed two hits in six shutout innings and the Pittsburgh Pirates made quick work of the Arizona Diamondbacks, 4-1 on Wednesday night.
''Just pitching with a lot more confidence, figuring himself out,'' Pirates manager Clint Hurdle said. ''I think he was able to make some minor adjustments and it was fun to watch him out there tonight.''
Happ (5-7), acquired at the trade deadline from Seattle, struck out three and walked two to earn his first National League victory since pitching for Houston in 2012. Pittsburgh brought in Happ to bolster a rotation that has slipped a bit in recent weeks. He's improved in each of his three starts since coming over, losing to the Cubs on Aug. 4 and getting a no-decision against the New York Mets on Friday before completely shutting down Arizona.
''Trusting your stuff, whether you're feeling great or not,'' Happ said. ''I didn't think I had my best fastball tonight compared to the game in New York, but still throwing with conviction, trying to locate and mix it up.''
Sean Rodriguez had three hits and an RBI for the Pirates. Starling Marte added two hits and Gregory Polanco chipped in an RBI single off Robbie Ray (3-9).
''I kind of got away from who I was as a pitcher and that's attacking guys,'' Ray said. ''You know, here's my stuff, see if you can hit it. I was trying to nibble at the corners and that's just not who I am.''
Mark Melancon struck out three straight batters in the ninth for his 38th save. Pittsburgh improved to 16-3 against teams from the NL West and is 57-31 since May 9, the best record in the majors. And they keep doing it in different ways with different people.
On Tuesday night - actually early Wednesday morning - Pedro Florimon hit a walkoff triple to give Pittsburgh a 9-8 win in 15 innings. By the middle of Wednesday afternoon Florimon had been designated for assignment and the Pirates turned to Happ and Rodriguez, a role player, for a spark.
''You can sit down at the end of the day and anybody on the team can come through,'' Rodriguez said. ''(Florimon) being one that hadn't been up earlier in the year that just goes to show you it's not just 25 guys, it's 40 guys.''
Paul Goldschmidt had an RBI single in the ninth for Arizona but Melancon struck out A.J. Pollock, Jarrod Saltalamacchia and David Peralta for his 38th save one night after blowing his first save since April.
The Diamondbacks have played well of late and averaged 6.6 runs in their last nine games. The closest they got to a significant threat against Happ came when he issued consecutive walks to start the second inning. A double play and a harmless grounder later, Happ was out of trouble and on his way. He retired 14 of the final 16 batters he faced before being taken out after just 83 pitches.
Ray remained winless since July 7, dropping his fifth straight decision even though the Pirates failed to hit a home run for the first time in 13 games. Jung Ho Kang raced home on a wild pitch in the second, Rodriguez followed with a run-scoring single and Polanco forced Happ - who reached on a fielder's choice - to chug 270 feet from first to home after Polanco hit a slicing double to the gap in left-center.
ON THE MOVE
Arizona sent struggling RHP Chase Anderson to Triple-A Reno on Wednesday following another difficult start against Pittsburgh on Tuesday night. Anderson has lost four of five decisions while seeing his ERA rise to 4.51. The Diamondbacks called up RHP Zach Godley from Double-A Mobile.
The Pirates signed free agent OF Travis Snider on Wednesday and sent him to Triple-A Indianapolis. Pittsburgh traded Snider to Baltimore in the offseason, but Snider hit just .237 in 69 games with the Orioles before being released last week.
Diamondbacks: Arizona heads to Cincinnati on Thursday for a four-game set with the Reds. Patrick Corbin (3-3, 3.43 ERA) gets the start. Corbin is 2-0 in his last four starts. The Diamondbacks won two of three from Cincinnati in Arizona earlier this month.
Pirates: Pittsburgh hosts San Francisco on Thursday, the beginning of a four-game series that marks the Giants' first visit to PNC Park since beating the Pirates 8-0 in the Wild Card game last October. Charlie Morton (7-4, 4.36 ERA) faces Jake Peavy (3-5, 4.18). Pittsburgh swept three games from the Giants in San Francisco in June.
Follow Will Graves at www.twitter.com/WillGravesAP