diff options
author | 2010-11-06 01:21:28 +0000 | |
---|---|---|
committer | 2010-11-06 01:21:28 +0000 | |
commit | 67fc54f87988135c316f5d3b4ef2d90b59ba2374 (patch) | |
tree | 8192f94232602000ec4947fda35d3d1f67704add /Source/ModelViewer/DataModel.cs | |
parent | 34e5dd6c2177a83159982aca6c025ef95474689c (diff) |
Improve the generic model viewer
Diffstat (limited to 'Source/ModelViewer/DataModel.cs')
-rw-r--r-- | Source/ModelViewer/DataModel.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/ModelViewer/DataModel.cs b/Source/ModelViewer/DataModel.cs index 33211ef3..d83dfdd5 100644 --- a/Source/ModelViewer/DataModel.cs +++ b/Source/ModelViewer/DataModel.cs @@ -223,6 +223,14 @@ namespace Microsoft.Boogie.ModelViewer if (a != null) return a;
return b;
}
+
+ public static S GetWithDefault<T, S>(this Dictionary<T, S> dict, T key, S defl)
+ {
+ S r;
+ if (dict.TryGetValue(key, out r))
+ return r;
+ return defl;
+ }
}
}
|