[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/as_environment.h
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/as_environment.h |
Date: |
Tue, 09 Oct 2007 16:34:54 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/10/09 16:34:54
Modified files:
. : ChangeLog
server : as_environment.h
Log message:
* server/as_environment.h: don't use size() or length()
when empty() is really meant (in some cases empty() is much
faster).
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4579&r2=1.4580
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_environment.h?cvsroot=gnash&r1=1.57&r2=1.58
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4579
retrieving revision 1.4580
diff -u -b -r1.4579 -r1.4580
--- ChangeLog 9 Oct 2007 16:21:37 -0000 1.4579
+++ ChangeLog 9 Oct 2007 16:34:53 -0000 1.4580
@@ -1,3 +1,9 @@
+2007-10-10 Sandro Santilli <address@hidden>
+
+ * server/as_environment.h: don't use size() or length()
+ when empty() is really meant (in some cases empty() is much
+ faster).
+
2007-10-10 Chad Musick <address@hidden>
* server/vm/SafeStack.h: Remove limit on size of grow()
Index: server/as_environment.h
===================================================================
RCS file: /sources/gnash/gnash/server/as_environment.h,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -b -r1.57 -r1.58
--- server/as_environment.h 30 Sep 2007 05:24:36 -0000 1.57
+++ server/as_environment.h 9 Oct 2007 16:34:54 -0000 1.58
@@ -75,7 +75,7 @@
/// Pops an as_value off the stack top and return it.
as_value pop()
{
- assert( m_stack.size() > 0 );
+ assert( ! m_stack.empty() );
as_value result = m_stack.back();
m_stack.pop_back();
return result;
@@ -87,8 +87,9 @@
///
as_value& top(size_t dist)
{
- assert ( m_stack.size() > dist );
- return m_stack[m_stack.size() - 1 - dist];
+ size_t ssize = m_stack.size();
+ assert ( ssize > dist );
+ return m_stack[ssize - 1 - dist];
}
/// Get stack value at the given distance from bottom.
@@ -104,8 +105,9 @@
/// Drop 'count' values off the top of the stack.
void drop(size_t count)
{
- assert ( m_stack.size() >= count );
- m_stack.resize(m_stack.size() - count);
+ size_t ssize = m_stack.size();
+ assert ( ssize >= count );
+ m_stack.resize(ssize - count);
}
/// Insert 'count' undefined values before 'offset'.
@@ -280,7 +282,7 @@
///
void add_local_registers(unsigned int register_count)
{
- assert(_localFrames.size());
+ assert(!_localFrames.empty());
return _localFrames.back().registers.resize(register_count);
}
@@ -290,7 +292,7 @@
///
size_t num_local_registers() const
{
- assert(_localFrames.size());
+ assert(!_localFrames.empty());
return _localFrames.back().registers.size();
}
@@ -300,14 +302,14 @@
///
as_value& local_register(uint8_t n)
{
- assert(_localFrames.size());
+ assert(!_localFrames.empty());
return _localFrames.back().registers[n];
}
/// Set the Nth local register to something
void set_local_register(uint8_t n, as_value &val)
{
- if (_localFrames.size() )
+ if ( ! _localFrames.empty() )
{
Registers& registers = _localFrames.back().registers;
if ( n < registers.size() )
@@ -488,7 +490,7 @@
///
void popCallFrame()
{
- assert(_localFrames.size());
+ assert(!_localFrames.empty());
_localFrames.pop_back();
}
@@ -496,7 +498,7 @@
//
CallFrame& topCallFrame()
{
- assert(_localFrames.size());
+ assert(!_localFrames.empty());
return _localFrames.back();
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog server/as_environment.h,
Sandro Santilli <=