https://codereview.stackexchange.com/questions/37601/how-bad-is-duplicating-a-code-block
This got closed as off-topic. I read the help center and from it I concluded that rather than present possible alternatives in my question, it is better to just post my code and ask if anyone has ideas.
So I edited it. Is this question now considered on topic? I feel like I've vandalised my post in a desperate attempt to make it on topic.
Was the question better before or after the edit, and are either of them considered on topic? How could I get it on topic?