Fold ResourceSet::CommonInit into constructor (#23993)
authorJan Kotas <jkotas@microsoft.com>
Tue, 16 Apr 2019 00:37:41 +0000 (17:37 -0700)
committerGitHub <noreply@github.com>
Tue, 16 Apr 2019 00:37:41 +0000 (17:37 -0700)
src/System.Private.CoreLib/shared/System/Resources/ResourceSet.cs

index 2d33f3a..b076f29 100644 (file)
@@ -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