summaryrefslogtreecommitdiff
path: root/src/System.Private.CoreLib/shared/System/Globalization/DateTimeFormat.cs
diff options
context:
space:
mode:
authorBen Adams <thundercat@illyriad.co.uk>2019-01-20 23:42:10 +0100
committerJan Kotas <jkotas@microsoft.com>2019-01-20 14:42:10 -0800
commitefee81505366236a22a06663fc14927a516d5655 (patch)
tree978baa76ecafcce5af4d38b7f12505b969d3177c /src/System.Private.CoreLib/shared/System/Globalization/DateTimeFormat.cs
parent170854b92017d709bc82d7631c6cb33dd7443078 (diff)
downloadcoreclr-efee81505366236a22a06663fc14927a516d5655.tar.gz
coreclr-efee81505366236a22a06663fc14927a516d5655.tar.bz2
coreclr-efee81505366236a22a06663fc14927a516d5655.zip
Use List<T>.ToArray() in places (#22101)
* Use ReadOnlySpan.ToArray in places * Use List.ToArray * Don't take .Length in to local and use as loop condition
Diffstat (limited to 'src/System.Private.CoreLib/shared/System/Globalization/DateTimeFormat.cs')
-rw-r--r--src/System.Private.CoreLib/shared/System/Globalization/DateTimeFormat.cs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/System.Private.CoreLib/shared/System/Globalization/DateTimeFormat.cs b/src/System.Private.CoreLib/shared/System/Globalization/DateTimeFormat.cs
index ea7387589c..61143fecfd 100644
--- a/src/System.Private.CoreLib/shared/System/Globalization/DateTimeFormat.cs
+++ b/src/System.Private.CoreLib/shared/System/Globalization/DateTimeFormat.cs
@@ -1391,9 +1391,8 @@ namespace System
results.Add(strings[j]);
}
}
- string[] value = new string[results.Count];
- results.CopyTo(0, value, 0, results.Count);
- return (value);
+
+ return results.ToArray();
}
// This is a placeholder for an MDA to detect when the user is using a