OP described a simple 2-line fix that would have been annoying to find by hand. That's a matter of heuristic search. The majority of problems in software engineering do not fall in this category.