summaryrefslogtreecommitdiff
path: root/Source/Graph
diff options
context:
space:
mode:
authorGravatar mikebarnett <unknown>2011-03-10 17:37:58 +0000
committerGravatar mikebarnett <unknown>2011-03-10 17:37:58 +0000
commit768ee8abb31d912cfdc8eeaf41d7f44f1691ce0c (patch)
tree533ab6aa0d91c5a5e7c66125834fb5b8695ccf71 /Source/Graph
parente28c62b12194be07e3ecb3301e6b3e0336bcac2a (diff)
Renamed NonNullElements to NonNullDictionaryAndValues because the keys to dictionaries are non-null, which is enforced by the implementation of Dictionary.
Added class constraints to all of the generic NonNull and NonNullElements methods so only non-value types will be checked.
Diffstat (limited to 'Source/Graph')
-rw-r--r--Source/Graph/Graph.cs6
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/Graph/Graph.cs b/Source/Graph/Graph.cs
index bc256cd5..8c01d8db 100644
--- a/Source/Graph/Graph.cs
+++ b/Source/Graph/Graph.cs
@@ -33,7 +33,8 @@ namespace Graphing {
foreach (KeyValuePair<Node, List<Node>> de in d) {
if (!first)
sb.Append(", ");
- sb.Append(cce.NonNull(de.Key).ToString());
+ Contract.Assert(!object.Equals(de.Key,default(Node)));
+ sb.Append(de.Key.ToString());
sb.Append("~>");
sb.Append(ListToString(de.Value));
first = false;
@@ -131,7 +132,8 @@ namespace Graphing {
foreach (KeyValuePair<Node, List<Node>> de in domMap) {
if (!first)
sb.Append(", ");
- sb.Append(cce.NonNull(de.Key).ToString());
+ Contract.Assert(!object.Equals(de.Key, default(Node)));
+ sb.Append(de.Key.ToString());
sb.Append("~>");
sb.Append(ListToString(de.Value));
first = false;