akalipetis/Calculator — comment on commit ffa44782b4060b5b9171919e679b5f0e16907064
File: Calculator/CalculatorBrain.m line 80
By andreasnomikos:

A better implementation would be to just scrap and recreate the stack. This would be O(1) instead of O(n) that you have know.