summaryrefslogtreecommitdiff
path: root/Source/CodeContractsExtender
diff options
context:
space:
mode:
authorGravatar mikebarnett <unknown>2011-03-10 22:38:47 +0000
committerGravatar mikebarnett <unknown>2011-03-10 22:38:47 +0000
commit3e33bdafb4d882a435f948defaf2c337e06d5191 (patch)
tree8f0484f1ef7e75c36fcee6cc9c6fe9da7ddafd7f /Source/CodeContractsExtender
parent768ee8abb31d912cfdc8eeaf41d7f44f1691ce0c (diff)
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.
Diffstat (limited to 'Source/CodeContractsExtender')
-rw-r--r--Source/CodeContractsExtender/cce.cs4
1 files changed, 4 insertions, 0 deletions
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<T>(IEnumerator<T> iEnumerator) where T : class {
return iEnumerator != null;
}
+ [Pure]
+ public static bool NonNull<T>(HashSet<T> set) where T : class {
+ return set != null && !set.Contains(null);
+ }
//[Pure]
//public static bool NonNullElements<T>(Graphing.Graph<T> graph) {
// return cce.NonNullElements(graph.TopologicalSort());