Exit early during checkInvariants rather than do the O(N) loop.

This loop is useful for debugging arrays but is too slow for
general use, so we'll just "return true" before it and leave it in
place for offline use.
Esse commit está contido em:
Bert Maher
2013-07-18 17:31:58 -07:00
commit de Sara Golemon
commit abca91e0fa
+3
Ver Arquivo
@@ -323,6 +323,9 @@ bool HphpArray::checkInvariants() const {
assert(m_hash);
assert(m_hLoad >= m_size);
size_t load = 0;
return true;
// The following loop is for debugging arrays only; it slows
// things down too much for general use
for (size_t i = 0; i <= m_tableMask; i++) {
load += m_hash[i] != ElmIndEmpty;
}