Skip to content

Commit e654570

Browse files
authored
Update TagName docs to include behavior if tag is not found (#109934)
* Clarify documentation for TagList.IndexOf Adds documentation to TagList.IndexOf that states the behavior when the key was not found. * Clarify documentation for TagList.IndexOf Adds documentation to TagList.IndexOf that states the behavior when the key was not found.
1 parent 78ede32 commit e654570

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/TagList.netcore.cs

+1
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ public bool Remove(KeyValuePair<string, object?> item)
266266
/// Searches for the specified tag and returns the zero-based index of the first occurrence within the entire <see cref="T:System.Diagnostics.TagList" />.
267267
/// </summary>
268268
/// <param name="item">The tag to locate in the <see cref="T:System.Diagnostics.TagList" />.</param>
269+
/// <returns>The zero-based index of the first occurrence within the <see cref="T:System.Diagnostics.TagList" />, or -1 if there is no such tag.</returns>
269270
public readonly int IndexOf(KeyValuePair<string, object?> item)
270271
{
271272
ReadOnlySpan<KeyValuePair<string, object?>> tags =

src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/TagList.netfx.cs

+1
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,7 @@ public bool Remove(KeyValuePair<string, object?> item)
416416
/// Searches for the specified tag and returns the zero-based index of the first occurrence within the entire <see cref="T:System.Diagnostics.TagList" />.
417417
/// </summary>
418418
/// <param name="item">The tag to locate in the <see cref="T:System.Diagnostics.TagList" />.</param>
419+
/// <returns>The zero-based index of the first occurrence within the <see cref="T:System.Diagnostics.TagList" />, or -1 if there is no such tag.</returns>
419420
public readonly int IndexOf(KeyValuePair<string, object?> item)
420421
{
421422
if (_overflowTags is not null)

0 commit comments

Comments
 (0)