Snippet · Writing & changing code
Refactor exactly one thing
Scope the blast radius to a single function.
Here is one function: <paste> It works. I don't want new behaviour — I want it easier to read. - Same inputs, same outputs, same side effects. - Tell me first, in two lines, what makes it hard to read. - Then the rewrite. - Then list anything the rewrite changed that I should test. Do not touch anything outside this function.
"Refactor this" with no boundary is an invitation to rewrite your project. One function, stated behaviour, explicit limits.