Example #1
0
 private static void OldContractStaticMessage(int i, ContractOverheadNullCheckBenchmark @this)
 {
     System.Diagnostics.ContractsLight.Contract.RequiresNotNull(@this, "i >= 0");
 }
Example #2
0
 private static void NewContractStaticMessage(int i, ContractOverheadNullCheckBenchmark @this)
 {
     Contract.Check(@this != null)?.Requires($"i >= 0");
 }
Example #3
0
 private static void NewContractIsCheckMessage(int i, ContractOverheadNullCheckBenchmark @this)
 {
     Contract.Check(@this is object)?.Requires($"i >= 0, i={i}");
 }