System.Linq.Enumerable.Repeat method: Explanation for count argument slightly inaccurate (nitpicking)

Open Beginner friendly
#4,012 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
72/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Stale
Tech stack
csharp
Domain
documentation

Research direction

Open xml/System.Linq/Enumerable.xml around line 8566 and review the count argument description for Enumerable.Repeat. Update it so it accurately states how many times the value occurs, including the zero-count case. Done means the parameter wording matches the method's behavior and the generated API documentation reflects the correction.

Written by the indexing model from the issue text.

Description

area-System.Linq Pri3 untriaged

I admit, this issue report is on the verge of nitpicking, but nevertheless...

The count argument for the Enumerable.Repeat method currently states:

The number of times to repeat the value in the generated sequence

This is of course incorrect :)
In fact, the value is repeated count-1 times in the generated sequence; when count is being 0 the generated sequence is empty.

A more accurate description for the count argument could perhaps be something like:

The number of times the value occurs in the generated sequence


Github link to the respective line in the documentation source: https://github.com/dotnet/dotnet-api-docs/blob/739ea290c4423665b5f06ca6938b75c8b5b6e11b/xml/System.Linq/Enumerable.xml#L8566

Link to documentation: https://docs.microsoft.com/en-us/dotnet/api/system.linq.enumerable.repeat?view=netstandard-2.1

Dominant language
C#
Stars
950
Forks
1.7k
Avg merge
3d 5h
Merged PRs (30d)
38

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/dotnet-api-docs

All issues in dotnet/dotnet-api-docs

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.