3 ms·
How is not having map.clear() a brilliant design?
by apta 8y ago
How is not having map.clear() a brilliant design?
- stcredzero 8y agoIn a large project, you'll have all ways of doing any given thing represented in a code base. Reducing that number down to 1 means that searching for all occurrences is reduced to 1 operation. If you are working on a large project, searching for usages/senders/occurrences is one of the most common tasks that you do. In fact, using escape analysis of the same kind used for "Extract Method" refactorings, you can even catch clearing interspersed with other code in the for-range loop. A 50%+ reduction in programmer work is nothing to be sneezed at.