private void sortForward(int par1)
    {
        PathPoint var2 = this.pathPoints[par1];
        float var3 = var2.distanceToTarget;

        while (true)
        {
            int var4 = 1 + (par1 << 1);
            int var5 = var4 + 1;

            if (var4 >= this.count)
            {
                break;
            }

            PathPoint var6 = this.pathPoints[var4];
            float var7 = var6.distanceToTarget;
            PathPoint var8;
            float var9;

            if (var5 >= this.count)
            {
                var8 = null;
                var9 = Float.POSITIVE_INFINITY;
            }
            else
            {
                var8 = this.pathPoints[var5];
                var9 = var8.distanceToTarget;
            }

            if (var7 < var9)
            {
                if (var7 >= var3)
                {
                    break;
                }

                this.pathPoints[par1] = var6;
                var6.index = par1;
                par1 = var4;
            }
            else
            {
                if (var9 >= var3)
                {
                    break;
                }

                this.pathPoints[par1] = var8;
                var8.index = par1;
                par1 = var5;
            }
        }

        this.pathPoints[par1] = var2;
        var2.index = par1;
    }