Feature request: variation on safe delete for method parameters

I have the following code (don't mind the syntax):

void BW_T8(string idMag, string destinationDirectory, string asciiFile, CDB myDB)

{


     ...

     var sql = "SELECT DISTINCT asciifile FROM mgtable where idmag='" + idMag

     var table = myDB.DataLink.ExecuteDTableSQL(sql);

     asciiFile = table.Rows[0][0].ToString();
     ...


}



ReSharper highlights the method parameter asciiFile and informs me that The value passed in is never used and overridden in the method body which is correct. I would like to have a variation of safe deleting this method parameter so that the resulting code is as follows:


void BW_T8(string idMag, string destinationDirectory, CDB myDB)

{


     ...     var sql = "SELECT DISTINCT asciifile FROM mgtable where idmag='" + idMag


     var table = myDB.DataLink.ExecuteDTableSQL(sql);
     var asciiFile = table.Rows[0][0].ToString();
     ...
}



Note that the method parameter asciiFile has been removed and that asciiFile is now declared in the method body.

Please sign in to leave a comment.