zoukankan      html  css  js  c++  java
  • ListComparer

        using System;
        using System.Collections;
        using System.Runtime.CompilerServices;

        public static class ListComparer
        {
            public static bool ListsEqual(IList list1, IList list2)
            {
                if (list1.Count != list2.Count)
                {
                    return false;
                }
                for (int i = 0; i < list1.Count; i++)
                {
                    if (list1[i] != list2[i])
                    {
                        return false;
                    }
                }
                return true;
            }

            public static bool ListsEqual(IList list1, IList list2, ObjectCompareDelegate compare)
            {
                if (list1.Count != list2.Count)
                {
                    return false;
                }
                for (int i = 0; i < list1.Count; i++)
                {
                    if (!compare(list1[i], list2[i]))
                    {
                        return false;
                    }
                }
                return true;
            }

            public delegate bool ObjectCompareDelegate(object x, object y);
        }

  • 相关阅读:
    元数据 缓存 池 模式
    ContractPattern 面向面向契约模式
    第三方登录 ----转载自简书,作者 <<碧霄问鼎>>
    证书那些事
    导航(NavanavigationController)push和pop
    iOS app上传错误集锦(转载)
    Block 的基本用法
    正则表达式的用法 转载
    UIView
    UIDate(时间)
  • 原文地址:https://www.cnblogs.com/bigmouthz/p/1668637.html
Copyright © 2011-2022 走看看