aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2007-02-18 18:08:38 +0000
committerMax Horn2007-02-18 18:08:38 +0000
commite0a7c6d7a78f306b7aa2a60eec9c698119090515 (patch)
tree2100a288e92399fee63e8b2a3c6f7a969efbf933
parent348b72e107e39cb95559ebfdc7b835dbcfd14fc8 (diff)
downloadscummvm-rg350-e0a7c6d7a78f306b7aa2a60eec9c698119090515.tar.gz
scummvm-rg350-e0a7c6d7a78f306b7aa2a60eec9c698119090515.tar.bz2
scummvm-rg350-e0a7c6d7a78f306b7aa2a60eec9c698119090515.zip
Made it possible to init a Stack<T> with an Array<T>; removed hack in Stack<T>::top
svn-id: r25696
-rw-r--r--common/stack.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/common/stack.h b/common/stack.h
index 123cacd6cb..2cc85388e0 100644
--- a/common/stack.h
+++ b/common/stack.h
@@ -85,6 +85,7 @@ protected:
Array<T> _stack;
public:
Stack<T>() {}
+ Stack<T>(const Array<T> &stackContent) : _stack(stackContent) {}
bool empty() const {
return _stack.empty();
@@ -97,10 +98,7 @@ public:
}
T top() const {
const int s = size();
- if (s > 0)
- return _stack[s - 1];
- else
- return 0;
+ return _stack[s - 1];
}
T pop() {
T tmp = top();