4 writes to _metadata
Microsoft.Build.Utilities.Core (4)
TaskItem.cs (4)
101_metadata = new CopyOnWriteDictionary<string>(MSBuildNameIgnoreCaseComparer.Default); 227_metadata = value; 267_metadata ??= new CopyOnWriteDictionary<string>(MSBuildNameIgnoreCaseComparer.Default); 485_metadata ??= new CopyOnWriteDictionary<string>(MSBuildNameIgnoreCaseComparer.Default);
25 references to _metadata
Microsoft.Build.Utilities.Core (25)
TaskItem.cs (25)
109_metadata[key] = (string)singleMetadata.Value ?? string.Empty; 192int count = (_metadata?.Count ?? 0) + FileUtilities.ItemSpecModifiers.All.Length; 196if (_metadata is not null) 198metadataNames.AddRange(_metadata.Keys); 211public int MetadataCount => (_metadata?.Count ?? 0) + FileUtilities.ItemSpecModifiers.All.Length; 223return _metadata; 245_metadata?.Remove(metadataName); 269_metadata[metadataName] = metadataValue ?? string.Empty; 301if (_metadata != null) 309copiedMetadata = _metadata.Clone(); // Copy on write! 311else if (destinationAsTaskItem.Metadata.Count < _metadata.Count) 313copiedMetadata = _metadata.Clone(); // Copy on write! 319copiedMetadata.SetItems(_metadata.Where(entry => !destinationAsTaskItem.Metadata.TryGetValue(entry.Key, out string val) || String.IsNullOrEmpty(val))); 325foreach (KeyValuePair<string, string> entry in _metadata) 380if (_metadata != null) 382foreach (KeyValuePair<string, string> entry in _metadata) 442_metadata?.TryGetValue(metadataName, out metadataValue); 461IDictionary ITaskItem2.CloneCustomMetadataEscaped() => _metadata == null 463: _metadata.Clone(); 486_metadata.SetItems(metadata.Select(kvp => new KeyValuePair<string, string>(kvp.Key, kvp.Value ?? string.Empty))); 491if (_metadata == null) 496int count = _metadata.Count; 499foreach (var kvp in _metadata) 510if (_metadata == null) 515foreach (var kvp in _metadata)