summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/Array.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/engine/Array.h')
-rw-r--r--src/libs/engine/Array.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/libs/engine/Array.h b/src/libs/engine/Array.h
index e1f1c28d..047ab49e 100644
--- a/src/libs/engine/Array.h
+++ b/src/libs/engine/Array.h
@@ -44,14 +44,12 @@ public:
}
}
- Array(size_t size, const Array<T>* contents) : m_size(size), m_top(size+1) {
+ Array(size_t size, const Array<T>& contents) : m_size(size), m_top(size+1) {
m_elems = new T[size];
- if (contents) {
- if (size <= contents->size())
- memcpy(m_elems, contents->m_elems, size * sizeof(T));
- else
- memcpy(m_elems, contents->m_elems, contents->size() * sizeof(T));
- }
+ if (size <= contents.size())
+ memcpy(m_elems, contents.m_elems, size * sizeof(T));
+ else
+ memcpy(m_elems, contents.m_elems, contents.size() * sizeof(T));
}
~Array() {