4 writes to _metadata
Microsoft.Build.Utilities.Core (4)
TaskItem.cs (4)
123_metadata = new CopyOnWriteDictionary<string>(MSBuildNameIgnoreCaseComparer.Default); 249_metadata = value; 289_metadata ??= new CopyOnWriteDictionary<string>(MSBuildNameIgnoreCaseComparer.Default); 507_metadata ??= new CopyOnWriteDictionary<string>(MSBuildNameIgnoreCaseComparer.Default);
25 references to _metadata
Microsoft.Build.Utilities.Core (25)
TaskItem.cs (25)
131_metadata[key] = (string)singleMetadata.Value ?? string.Empty; 214int count = (_metadata?.Count ?? 0) + FileUtilities.ItemSpecModifiers.All.Length; 218if (_metadata is not null) 220metadataNames.AddRange(_metadata.Keys); 233public int MetadataCount => (_metadata?.Count ?? 0) + FileUtilities.ItemSpecModifiers.All.Length; 245return _metadata; 267_metadata?.Remove(metadataName); 291_metadata[metadataName] = metadataValue ?? string.Empty; 323if (_metadata != null) 331copiedMetadata = _metadata.Clone(); // Copy on write! 333else if (destinationAsTaskItem.Metadata.Count < _metadata.Count) 335copiedMetadata = _metadata.Clone(); // Copy on write! 341copiedMetadata.SetItems(_metadata.Where(entry => !destinationAsTaskItem.Metadata.TryGetValue(entry.Key, out string val) || String.IsNullOrEmpty(val))); 347foreach (KeyValuePair<string, string> entry in _metadata) 402if (_metadata != null) 404foreach (KeyValuePair<string, string> entry in _metadata) 464_metadata?.TryGetValue(metadataName, out metadataValue); 483IDictionary ITaskItem2.CloneCustomMetadataEscaped() => _metadata == null 485: _metadata.Clone(); 508_metadata.SetItems(metadata.Select(kvp => new KeyValuePair<string, string>(kvp.Key, kvp.Value ?? string.Empty))); 513if (_metadata == null) 518int count = _metadata.Count; 521foreach (var kvp in _metadata) 532if (_metadata == null) 537foreach (var kvp in _metadata)