mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-13 20:55:00 +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:
@@ -227,7 +227,7 @@ template<> jsval ScriptInterface::ToJSVal<Grid<u16> >(JSContext* cx, const Grid<
|
||||
return JSVAL_VOID;
|
||||
|
||||
js::TypedArray *tdest = js::TypedArray::fromJSObject(darray);
|
||||
debug_assert(tdest->byteLength == len*sizeof(u16));
|
||||
ENSURE(tdest->byteLength == len*sizeof(u16));
|
||||
|
||||
memcpy(tdest->data, val.m_Data, tdest->byteLength);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user