2 ms·
And in the other direction, when adding flags etc to a method that was created to reduce duplication, consider if splitting it into two "duplicate" copies or co
by detaro 7y ago
And in the other direction, when adding flags etc to a method that was created to reduce duplication, consider if splitting it into two "duplicate" copies or copy it to the call-site requiring the flag isn't the better alternative.
- danabramov 7y agoYes. If extracting and deduplicating is in your toolbox, so should be inlining and duplicating.
- ahartmetz 7y agoOr, if possible, split up the helper into smaller units of functionality that can be combined as appropriate for different requirements. That could possibly work for the original article's problem, too.