Example #1
0
        public static OrdMap <U, W> ToOrdMap <K, V, U, W>(this IEnumerable <KeyValuePair <K, V> > kvs, Func <KeyValuePair <K, V>, U> f, Func <KeyValuePair <K, V>, W> g)
        {
            var res = new OrdMap <U, W>();

            foreach (var kv in kvs)
            {
                res.Add(f(kv), g(kv));
            }
            return(res);
        }
Example #2
0
        public static OrdMap <K, V> ToOrdMap <K, V>(this IEnumerable <KeyValuePair <K, V> > kvs)
        {
            var res = new OrdMap <K, V>();

            foreach (var kv in kvs)
            {
                res.Add(kv.Key, kv.Value);
            }
            return(res);
        }