TimeZoneInfo: Reduce intermediate allocations in GetTimeZoneIds on Unix (#8769)
authorJustin Van Patten <jvp@justinvp.com>
Tue, 3 Jan 2017 04:41:04 +0000 (20:41 -0800)
committerJan Kotas <jkotas@microsoft.com>
Tue, 3 Jan 2017 04:41:04 +0000 (20:41 -0800)
commit0bca3c16e17f199bd8734aa1e2579e8d07ffe560
treeaee63b77db9009fb6a848f103acab3b7461e9d1d
parentbc7199f76b2bb6ebb9f9bcc5e1ce4f9a399e3331
TimeZoneInfo: Reduce intermediate allocations in GetTimeZoneIds on Unix (#8769)

Avoid intermediate underlying array allocations as items are added to
the resulting List<string> by specifying the capacity. Also, change
the signature of the private method to return List<string> instead of
IEnumerable<string> to avoid the enumerator allocation when enumerating
the ids.
src/mscorlib/src/System/TimeZoneInfo.Unix.cs