+ my $first = $self->First;
+ return undef unless $first; # No entries to check
+
+ # Key should be the same for all values of the same ocfv
+ my $ocfv_key = $first->GetOCFVCacheKey;
+
+ # This cache relieves performance issues when adding large numbers of values
+ # to a CF since each add compares against the full list each time.
+
+ unless ( $_OCFV_CACHE->{$ocfv_key} ) {
+ # Load the cache with existing values
+ foreach my $item ( @{$self->ItemsArrayRef} ) {
+ push @{$_OCFV_CACHE->{$ocfv_key}}, {
+ 'ObjectId' => $item->Id,
+ 'CustomFieldObj' => $item->CustomFieldObj,
+ 'Content' => $item->_Value('Content'),
+ 'LargeContent' => $item->LargeContent };
+ }
+ }
+