In another Meta discussion about suggested edits, Mokubai♦ posted the following:
With code related edits if I do not know what the edit is doing or if it changes the output of the code in question, as it would appear to in your case, then I would rather see it rejected and the editor post their own answer.
Do we have an official policy on edits to code? If not, can we adopt one? I'd suggest that no edits to code should take place, except from the author. If code is wrong, users should post in comments and use down votes. If code is dangerous, then flag as Offensive or something similar, with a comment.
On the other hand, how many coding questions come up? Is this worthwhile setting in stone, one way or the other? If we have syntax highlighting on code blocks, I'd accept that as a valid edit (as long as other items in a post were updated as well).