TimeZoneInfo: Reduce intermediate allocations in GetTimeZoneIds on Unix (dotnet/corec...
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)
commitebf8b58c71c42f7f3d54bd9430d18a2ed1dc680e
treeed0d24e37365a59b55c35f3bc51d9f8e3f4836cd
parent6bbdc326f45db3427112985e8bed5166bde6547e
TimeZoneInfo: Reduce intermediate allocations in GetTimeZoneIds on Unix (dotnet/coreclr#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.

Commit migrated from https://github.com/dotnet/coreclr/commit/0bca3c16e17f199bd8734aa1e2579e8d07ffe560
src/coreclr/src/mscorlib/src/System/TimeZoneInfo.Unix.cs