From 3e33bdafb4d882a435f948defaf2c337e06d5191 Mon Sep 17 00:00:00 2001 From: mikebarnett Date: Thu, 10 Mar 2011 22:38:47 +0000 Subject: Replaced all dictionaries that mapped to bool (i.e., were being used to implement a set) with HashSet. Added a new NonNull method to the cce class that checks to make sure a set is non-null and does not contain null. --- Source/CodeContractsExtender/cce.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Source/CodeContractsExtender') diff --git a/Source/CodeContractsExtender/cce.cs b/Source/CodeContractsExtender/cce.cs index 71462c07..31de9a70 100644 --- a/Source/CodeContractsExtender/cce.cs +++ b/Source/CodeContractsExtender/cce.cs @@ -57,6 +57,10 @@ public static class cce { public static bool NonNullElements(IEnumerator iEnumerator) where T : class { return iEnumerator != null; } + [Pure] + public static bool NonNull(HashSet set) where T : class { + return set != null && !set.Contains(null); + } //[Pure] //public static bool NonNullElements(Graphing.Graph graph) { // return cce.NonNullElements(graph.TopologicalSort()); -- cgit v1.2.3