Commit 9a85a686 authored by David C. Lonie's avatar David C. Lonie Committed by Code Review
Browse files

Merge topic 'vtkIdList-performance-tweak' into master

9b8f6a60 Inline vtkIdList::InsertId for performance.
parents 388b3f11 9b8f6a60
......@@ -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