Skip to content

Commit ec652c1

Browse files
committed
Fold ResourceSet::CommonInit into constructor (dotnet/coreclr#23993)
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
1 parent 1141460 commit ec652c1

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/Common/src/CoreLib/System/Resources/ResourceSet.cs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ protected ResourceSet()
3636
{
3737
// To not inconvenience people subclassing us, we should allocate a new
3838
// hashtable here just so that Table is set to something.
39-
CommonInit();
39+
Table = new Hashtable();
4040
}
4141

4242
// For RuntimeResourceSet, ignore the Table parameter - it's a wasted
@@ -50,9 +50,9 @@ internal ResourceSet(bool junk)
5050
// on disk.
5151
//
5252
public ResourceSet(string fileName)
53+
: this()
5354
{
5455
Reader = new ResourceReader(fileName);
55-
CommonInit();
5656
ReadResources();
5757
}
5858

@@ -61,26 +61,21 @@ public ResourceSet(string fileName)
6161
// of data.
6262
//
6363
public ResourceSet(Stream stream)
64+
: this()
6465
{
6566
Reader = new ResourceReader(stream);
66-
CommonInit();
6767
ReadResources();
6868
}
6969

7070
public ResourceSet(IResourceReader reader)
71+
: this()
7172
{
7273
if (reader == null)
7374
throw new ArgumentNullException(nameof(reader));
7475
Reader = reader;
75-
CommonInit();
7676
ReadResources();
7777
}
7878

79-
private void CommonInit()
80-
{
81-
Table = new Hashtable();
82-
}
83-
8479
// Closes and releases any resources used by this ResourceSet, if any.
8580
// All calls to methods on the ResourceSet after a call to close may
8681
// fail. Close is guaranteed to be safely callable multiple times on a

0 commit comments

Comments
 (0)