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);
        }

  • 相关阅读:
    MySQL binlog 组提交与 XA(两阶段提交)
    mydumper 安装报错处理
    安装 gcc-c++ 时报错和原有 gcc 版本冲突
    mysql / mysqld_safe / mysqld 常见错误处理
    Linux 内核日志——dmesg
    Java中的Atomic包
    JAVA NIO中的Channels和Buffers
    字节流InputStream/OutputStream
    字符输出流Writer简要概括
    字符输入流Reader简要概括
  • 原文地址:https://www.cnblogs.com/bigmouthz/p/1668637.html
Copyright © 2011-2022 走看看