No. Bullets will barely fall out the end of 22" barreled 17. That extra two inches makes all the difference.
Just for grins and giggles I ran my favorite load of 24 grains of 4320 under a Hornady 25 grain HP through Quickloads. A 24 inch barrel shows 4179 fps and a 22 inch 4088 fps.
So you can see the extreme velocity loss you'll suffer by cutting back 2 inches.