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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun May 3 11:19:46 CEST 2009


Revision: 40267
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40267&view=rev
Author:   fingolfin
Date:     2009-05-03 09:19:46 +0000 (Sun, 03 May 2009)

Log Message:
-----------
COMMON: Simplified Common::Stack methods using the recent Common::Array improvements

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

Modified: scummvm/trunk/common/stack.h
===================================================================
--- scummvm/trunk/common/stack.h	2009-05-03 09:19:21 UTC (rev 40266)
+++ scummvm/trunk/common/stack.h	2009-05-03 09:19:46 UTC (rev 40267)
@@ -100,16 +100,14 @@
 		_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 {


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