Internally, the returned DirectoryInfo instance from Directory.CreateDirectory is not always needed.
Creating the instance takes some cycles that can be prevented so methods calling Directory.CreateDirectory will benefit from this, like Directory.Copy.
Add argument bool returnNull to method Directory.CreateDirectoryCore to accomplish this.
Internally, the returned
DirectoryInfo
instance fromDirectory.CreateDirectory
is not always needed. Creating the instance takes some cycles that can be prevented so methods callingDirectory.CreateDirectory
will benefit from this, likeDirectory.Copy
.Add argument
bool returnNull
to methodDirectory.CreateDirectoryCore
to accomplish this.