Removed Unused Local Random Instances (#10696)
authorRion Williams <rionmonster@gmail.com>
Tue, 4 Apr 2017 17:47:54 +0000 (12:47 -0500)
committerAditya Mandaleeka <adityamandaleeka@users.noreply.github.com>
Tue, 4 Apr 2017 17:47:54 +0000 (10:47 -0700)
* Removed Unused Local Random Instances

Discovered two cases of a `Random` instance that weren't being used
within their respective methods and removed them.

* Retained Earlier Comment

Retained an earlier comment for consistency

tests/src/baseservices/compilerservices/dynamicobjectproperties/testapis.cs

index 3e35252..179b052 100644 (file)
@@ -91,8 +91,6 @@ public class Driver<K, V>
         ConditionalWeakTable<K,V> tbl = new ConditionalWeakTable<K,V>();
 
         // Try to remove key from an empty dictionary
-        Random r = new Random();
-
         // Remove should return false
         Test.Eval(!tbl.Remove(keys[0]), "Err_005 Expected Remove to return false");
 
@@ -147,7 +145,6 @@ public class Driver<K, V>
 
         // Try to get non existing key
         // TryGetValue should return false and value should contian default(TValue)
-        Random r = new Random();
         Test.Eval(!tbl.TryGetValue(key, out val), "Err_011 Expected TryGetValue to return false");
         Test.Eval(val == null, "Err_012 Expected val to be null");
     }