You must be new here!
Lots of bad or incorrect edits get approved, all the time. Sometimes it's due to negligence, laziness or "robo-reviewers" trying to get their first badge.
Sometimes it's an honest mistake. In this case, frankly, the answer is so poorly annotated that at first glance and without a thorough understanding of what the answer was trying to say, the edit may appear useful and good.
I'd say the original author, the editor and the approvers are equally at fault here.
Fortunately, the fix is simple: roll back the edit and improve the answer to clarify that the double-equals is intended, and to explain why.
As it happens, Aerovistae's answer (currently in second place) is much better, providing the same solution but with annotations and explanations. The bigger question, then, is why that is not the accepted and most-highly-scored answer. For that, we need to look to a different Stack Overflow pattern, that the masses appear to appreciate brevity and simplicity over, well, the truth.