[Scummvm-cvs-logs] SF.net SVN: scummvm: [25696] scummvm/trunk/common/stack.h

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Feb 18 19:08:38 CET 2007


Revision: 25696
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25696&view=rev
Author:   fingolfin
Date:     2007-02-18 10:08:38 -0800 (Sun, 18 Feb 2007)

Log Message:
-----------
Made it possible to init a Stack<T> with an Array<T>; removed hack in Stack<T>::top

Modified Paths:
--------------
    scummvm/trunk/common/stack.h

Modified: scummvm/trunk/common/stack.h
===================================================================
--- scummvm/trunk/common/stack.h	2007-02-18 18:07:32 UTC (rev 25695)
+++ scummvm/trunk/common/stack.h	2007-02-18 18:08:38 UTC (rev 25696)
@@ -85,6 +85,7 @@
 	Array<T>	_stack;
 public:
 	Stack<T>() {}
+	Stack<T>(const Array<T> &stackContent) : _stack(stackContent) {}
 
 	bool empty() const {
 		return _stack.empty();
@@ -97,10 +98,7 @@
 	}
 	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();


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list