4 writes to _metadata
Microsoft.Build.Utilities.Core (4)
TaskItem.cs (4)
106_metadata = new CopyOnWriteDictionary<string>(MSBuildNameIgnoreCaseComparer.Default); 232_metadata = value; 272_metadata ??= new CopyOnWriteDictionary<string>(MSBuildNameIgnoreCaseComparer.Default); 490_metadata ??= new CopyOnWriteDictionary<string>(MSBuildNameIgnoreCaseComparer.Default);
25 references to _metadata
Microsoft.Build.Utilities.Core (25)
TaskItem.cs (25)
114_metadata[key] = (string)singleMetadata.Value ?? string.Empty; 197int count = (_metadata?.Count ?? 0) + FileUtilities.ItemSpecModifiers.All.Length; 201if (_metadata is not null) 203metadataNames.AddRange(_metadata.Keys); 216public int MetadataCount => (_metadata?.Count ?? 0) + FileUtilities.ItemSpecModifiers.All.Length; 228return _metadata; 250_metadata?.Remove(metadataName); 274_metadata[metadataName] = metadataValue ?? string.Empty; 306if (_metadata != null) 314copiedMetadata = _metadata.Clone(); // Copy on write! 316else if (destinationAsTaskItem.Metadata.Count < _metadata.Count) 318copiedMetadata = _metadata.Clone(); // Copy on write! 324copiedMetadata.SetItems(_metadata.Where(entry => !destinationAsTaskItem.Metadata.TryGetValue(entry.Key, out string val) || String.IsNullOrEmpty(val))); 330foreach (KeyValuePair<string, string> entry in _metadata) 385if (_metadata != null) 387foreach (KeyValuePair<string, string> entry in _metadata) 447_metadata?.TryGetValue(metadataName, out metadataValue); 466IDictionary ITaskItem2.CloneCustomMetadataEscaped() => _metadata == null 468: _metadata.Clone(); 491_metadata.SetItems(metadata.Select(kvp => new KeyValuePair<string, string>(kvp.Key, kvp.Value ?? string.Empty))); 496if (_metadata == null) 501int count = _metadata.Count; 504foreach (var kvp in _metadata) 515if (_metadata == null) 520foreach (var kvp in _metadata)