[12632] Revert previous commit (see Notes)

This commit is contained in:
billy1arm 2013-05-31 13:50:57 +01:00 committed by Antz
parent 1cd806c02e
commit ef445ea523
1462 changed files with 9689 additions and 7080 deletions

View file

@ -2,9 +2,9 @@
@file SmallArray.h
@created 2009-04-26
@edited 2009-04-26
@edited 2010-02-26
Copyright 2000-2009, Morgan McGuire, http://graphics.cs.williams.edu
Copyright 2000-2010, Morgan McGuire, http://graphics.cs.williams.edu
All rights reserved.
*/
#ifndef G3D_SmallArray_h
@ -12,6 +12,7 @@
#include "G3D/platform.h"
#include "G3D/Array.h"
#include "G3D/MemoryManager.h"
namespace G3D {
@ -46,6 +47,11 @@ public:
resize(0, shrinkIfNecessary);
}
void clearAndSetMemoryManager(MemoryManager::Ref& m) {
clear();
m_rest.clearAndSetMemoryManager(m);
}
inline T& operator[](int i) {
debugAssert(i < m_size && i >= 0);
if (i < N) {
@ -77,7 +83,7 @@ public:
push(v);
}
void fastRemove(int i) {
void fastRemove(int i, bool shrinkIfNecessary = false) {
debugAssert(i < m_size && i >= 0);
if (i < N) {
if (m_size <= N) {
@ -89,7 +95,7 @@ public:
}
} else {
// Removing from the rest array
m_rest.fastRemove(i - N);
m_rest.fastRemove(i - N, shrinkIfNecessary);
}
--m_size;
}