From f234acccc90d373e37429e7a47524919574bc61c Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Mon, 15 Apr 2019 17:37:41 -0700 Subject: [PATCH] Fold ResourceSet::CommonInit into constructor (dotnet/coreclr#23993) Commit migrated from https://github.com/dotnet/coreclr/commit/4aeedc147f45b63e6f07155fea1446b084cb9a46 --- .../src/System/Resources/ResourceSet.cs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Resources/ResourceSet.cs b/src/libraries/System.Private.CoreLib/src/System/Resources/ResourceSet.cs index 2d33f3a..b076f29 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Resources/ResourceSet.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Resources/ResourceSet.cs @@ -36,7 +36,7 @@ namespace System.Resources { // To not inconvenience people subclassing us, we should allocate a new // hashtable here just so that Table is set to something. - CommonInit(); + Table = new Hashtable(); } // For RuntimeResourceSet, ignore the Table parameter - it's a wasted @@ -50,9 +50,9 @@ namespace System.Resources // on disk. // public ResourceSet(string fileName) + : this() { Reader = new ResourceReader(fileName); - CommonInit(); ReadResources(); } @@ -61,26 +61,21 @@ namespace System.Resources // of data. // public ResourceSet(Stream stream) + : this() { Reader = new ResourceReader(stream); - CommonInit(); ReadResources(); } public ResourceSet(IResourceReader reader) + : this() { if (reader == null) throw new ArgumentNullException(nameof(reader)); Reader = reader; - CommonInit(); ReadResources(); } - private void CommonInit() - { - Table = new Hashtable(); - } - // Closes and releases any resources used by this ResourceSet, if any. // All calls to methods on the ResourceSet after a call to close may // fail. Close is guaranteed to be safely callable multiple times on a -- 2.7.4