diff options
-rw-r--r-- | common/stack.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/common/stack.h b/common/stack.h index be6f1b8d10..e76404bf4c 100644 --- a/common/stack.h +++ b/common/stack.h @@ -100,16 +100,14 @@ public: _stack.push_back(x); } T &top() { - const int s = size(); - return _stack[s - 1]; + return _stack.back(); } const T &top() const { - const int s = size(); - return _stack[s - 1]; + return _stack.back(); } T pop() { - T tmp = top(); - _stack.remove_at(size() - 1); + T tmp = _stack.back(); + _stack.pop_back(); return tmp; } int size() const { |