From d1467b27944cc71bdf1c2b6350ab7d60933fedb3 Mon Sep 17 00:00:00 2001 From: MichalMoskal Date: Thu, 17 Feb 2011 18:59:33 +0000 Subject: Add IEnumerable.Iter --- Source/Core/Util.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Source/Core/Util.cs') diff --git a/Source/Core/Util.cs b/Source/Core/Util.cs index 6ed01e7f..d0d8693a 100644 --- a/Source/Core/Util.cs +++ b/Source/Core/Util.cs @@ -48,6 +48,11 @@ namespace Microsoft.Boogie { l.RemoveRange(l.Count - count, count); return l; } + + public static void Iter(this IEnumerable coll, Action fn) + { + foreach (var e in coll) fn(e); + } } public class TokenTextWriter : IDisposable { -- cgit v1.2.3