------------------------------------------------------------------------------
| 967 | |
| 968 | //------------------------------------------------------------------------------ |
| 969 | void vtkStringArray::DataElementChanged(vtkIdType id) |
| 970 | { |
| 971 | if (this->Lookup) |
| 972 | { |
| 973 | if (this->Lookup->Rebuild) |
| 974 | { |
| 975 | // We're already going to rebuild the lookup table. Do nothing. |
| 976 | return; |
| 977 | } |
| 978 | |
| 979 | if (this->Lookup->CachedUpdates.size() > static_cast<size_t>(this->GetNumberOfTuples() / 10)) |
| 980 | { |
| 981 | // At this point, just rebuild the full table. |
| 982 | this->Lookup->Rebuild = true; |
| 983 | } |
| 984 | else |
| 985 | { |
| 986 | // Insert this change into the set of cached updates |
| 987 | std::pair<const ValueType, vtkIdType> value(this->GetValue(id), id); |
| 988 | this->Lookup->CachedUpdates.insert(value); |
| 989 | } |
| 990 | } |
| 991 | } |
| 992 | |
| 993 | //------------------------------------------------------------------------------ |
| 994 | void vtkStringArray::ClearLookup() |
no test coverage detected