Removing Unnecessary CloseBuffer calls
authorRama Krishnan Raghupathy <ramarag@microsoft.com>
Wed, 29 Mar 2017 01:09:12 +0000 (18:09 -0700)
committerRama Krishnan Raghupathy <ramarag@microsoft.com>
Wed, 29 Mar 2017 01:09:12 +0000 (18:09 -0700)
Commit migrated from https://github.com/dotnet/coreclr/commit/c082bf271567b3dc44d80b37b2b5c8eed5b95f64

src/coreclr/src/ilasm/grammar_after.cpp
src/coreclr/src/utilcode/safewrap.cpp

index 344e504..53d141d 100644 (file)
@@ -854,7 +854,6 @@ Its_An_Id:
                                                 TRUE, wzFullName,&pwz);
                                     if(dw != 0)
                                     {
-                                        wzFullName.CloseBuffer((COUNT_T)(dw));
                                         delete [] wzFile;
 
                                         wzFile = wzFullName.GetCopyOfUnicodeString();
index 4a6ecdb..294743d 100644 (file)
@@ -40,12 +40,9 @@ void ClrGetCurrentDirectory(SString & value)
 
     // An actual API failure in GetCurrentDirectory failure should be very rare, so we'll throw on those.
     if (len == 0)
-    {   
-        value.CloseBuffer(0);    
+    {
         ThrowLastError();
     }
-    
-    value.CloseBuffer();
 }
 
 // Nothrowing wrapper.