AcTools.Tests.Temporary.Dswap C# (CSharp) Метод

Dswap() приватный статический Метод

private static Dswap ( int a, int i, int j, int d ) : bool
a int
i int
j int
d int
Результат bool
        private static bool Dswap(int[] a, int i, int j, int d) {
            bool r = false;

            if (i == j) return true;
            
            if (a[i] >= j - d && a[i] <= j + d &&
                a[j] >= i - d && a[j] <= i + d) {
                r = true;
                int t = a[i];
                a[i] = a[j];
                a[j] = t;

                //if (a[i] == i) throw new Exception("Was here!");
                //if (a[j] == j) throw new Exception("Was here!");
            }

            return r;
        }