Lt. Joseph Rochefort, along with his OP-20-G cryptanalyst colleagues in Hawaii, made a major contribution to the success at Midway.
Breaking the code only helped in that we could do a little more to fortify Midway. As it turned out the long range high flying Army bombers had no effect on the Japanese fleet. In fact high flying precision bombers never did do much against ships for the entire war.
The American carriers still had to beat them in battle. In a way it was just what the Japanese wanted, to lure the remaining American carriers into a battle where they could sink them all. It turned out we had one more carrier than they thought but I would bet they would have chosen to fight us at Midway even so since they still had 4 and had shown they could beat us.