mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 23:25:43 +00:00
split debug_assert into ENSURE and ASSERT as discussed in a previous meeting.
the old debug_assert always ran and tested the expression, which slows down release builds. wrapping them in #ifndef NDEBUG is clumsy. the new ASSERT behaves like assert and ENSURE like the old debug_assert. Let's change any time-critical but not-super-important ENSURE to ASSERT to speed up release builds. (already done in bits.h and unique_range.h) This was SVN commit r9362.
This commit is contained in:
@@ -51,7 +51,7 @@ jsval CScriptValRooted::get() const
|
||||
|
||||
jsval& CScriptValRooted::getRef() const
|
||||
{
|
||||
debug_assert(m_Val);
|
||||
ENSURE(m_Val);
|
||||
return *m_Val;
|
||||
}
|
||||
|
||||
@@ -83,13 +83,13 @@ JSIdArray* AutoJSIdArray::get() const
|
||||
|
||||
size_t AutoJSIdArray::length() const
|
||||
{
|
||||
debug_assert(m_IdArray);
|
||||
ENSURE(m_IdArray);
|
||||
return m_IdArray->length;
|
||||
}
|
||||
|
||||
jsid AutoJSIdArray::operator[](size_t i) const
|
||||
{
|
||||
debug_assert(m_IdArray);
|
||||
debug_assert(i < (size_t)m_IdArray->length);
|
||||
ENSURE(m_IdArray);
|
||||
ENSURE(i < (size_t)m_IdArray->length);
|
||||
return m_IdArray->vector[i];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user