mirror of https://github.com/CGAL/cgal
Bugfix: only test existing values in the array
This commit is contained in:
parent
9ea82441c2
commit
d6d189b4a1
|
|
@ -98,8 +98,8 @@ public:
|
||||||
{
|
{
|
||||||
if (m_size != MaxSize)
|
if (m_size != MaxSize)
|
||||||
{
|
{
|
||||||
for (const Key& a : m_array)
|
for (std::size_t i = 0; i < m_size; ++ i)
|
||||||
if (a == key)
|
if (m_array[i] == key)
|
||||||
return false;
|
return false;
|
||||||
m_array[m_size ++] = key;
|
m_array[m_size ++] = key;
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue