mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-10 03:05:42 +00:00
🛠 Pre-allocate StringBuilder capacity
This commit is contained in:
parent
3afc1d967c
commit
5f8458f185
@ -129,7 +129,7 @@
|
|||||||
/// <paramref name="count"/> times.</returns>
|
/// <paramref name="count"/> times.</returns>
|
||||||
public static string Repeat(this string str, int count)
|
public static string Repeat(this string str, int count)
|
||||||
{
|
{
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder(str.Length * count);
|
||||||
|
|
||||||
for (int i = 0; i < count; i++)
|
for (int i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user