One could question how much of an upgrade Glock has made. The teething problems with the various Gen 4 models were epic. Among other things, the 40s still malfed on a regular basis with no readily identifiable consistent cause, even without a mounted light, and the 9s did not work reliably. I know cops whose agencies went through miserable experiences with the pistols and even worse with the "service". (And I am not a Glock hater; got two, and they are the pistols I am most likely to carry.)
FWIW, S&W has been making incremental changes/improvements all along too. Hard use/high volume shooters have given them feedback that at least to some extent has been effective. (Some of the barrel issues with the FS9 have been addressed; some related issues may not have been.) I am pretty sure that the odds of having a problem with any major manufacturer's service pistols are pretty much similar across the board, even though there are some I would avoid. If I had to carry a .40, it would be an M&P, with an X300U and a quality RDS, especially if Safariland would get off their backside and make the 6354 for the M&Ps.