Skip to content

Commit

Permalink
Correct wrong claim about StringBuilder performance. (#2253)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pedro-V authored Apr 23, 2024
1 parent 85b1a0b commit 3362af9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ If readability is your primary concern (and it usually should be), the LINQ-base
The `Array.Reverse()` approach is the best performing apporach.
For a more detailed breakdown, check the [performance article][article-performance].

The `StringBuilder` approach has the worst performance of the listed approach, and is more error-prone to write as it has to deal with lower and upper bounds checking.
The `StringBuilder` approach has the second worst performance (after the LINQ-based) of the listed approach, and is more error-prone to write as it has to deal with lower and upper bounds checking.

[constructor-array-chars]: https://learn.microsoft.com/en-us/dotnet/api/system.string.-ctor
[article-performance]: https://exercism.org/tracks/csharp/exercises/reverse-string/articles/performance
Expand Down

0 comments on commit 3362af9

Please sign in to comment.