Commit 9b8f6a60 authored by David C. Lonie's avatar David C. Lonie
Browse files

Inline vtkIdList::InsertId for performance.

Change-Id: Ie9cebe89c7382495023cb799d4babaf5083e7fdc
parent 99101fdf
......@@ -58,19 +58,6 @@ void vtkIdList::SetNumberOfIds(const vtkIdType number)
this->NumberOfIds = number;
}
void vtkIdList::InsertId(const vtkIdType i, const vtkIdType vtkid)
{
if ( i >= this->Size )
{
this->Resize(i+1);
}
this->Ids[i] = vtkid;
if ( i >= this->NumberOfIds )
{
this->NumberOfIds = i + 1;
}
}
vtkIdType vtkIdList::InsertUniqueId(const vtkIdType vtkid)
{
for (vtkIdType i=0; i < this->NumberOfIds; i++)
......
......@@ -129,6 +129,20 @@ private:
void operator=(const vtkIdList&); // Not implemented.
};
// In-lined for performance
inline void vtkIdList::InsertId(const vtkIdType i, const vtkIdType vtkid)
{
if (i >= this->Size)
{
this->Resize(i + 1);
}
this->Ids[i] = vtkid;
if (i >= this->NumberOfIds)
{
this->NumberOfIds = i + 1;
}
}
// In-lined for performance
inline vtkIdType vtkIdList::InsertNextId(const vtkIdType vtkid)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment