Esempio n. 1
0
        /// <summary>
        /// Indicates whether the current object is equal to another object.
        /// The object is equal iff the internal buffer contents and length are the same.
        /// </summary>
        /// <param name="other">An object to compare with this object.</param>
        /// <returns>
        /// true if the current object is equal to the <paramref name="other"/> parameter;
        /// otherwise, false.
        /// </returns>
        public bool Equals(IArrayBlock other)
        {
            if (ReferenceEquals(other, null))
            {
                return(false);
            }

            if (!ReferenceEquals(other, this))
            {
                if (this.Length != other.Length)
                {
                    return(false);
                }

                for (var i = 0; i < this.Length; i++)
                {
                    if (this[i] != other[i])
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }
Esempio n. 2
0
        public void Release(IArrayBlock item)
        {
            CheckDisposed();

            LeakStatus--;
            var block = Ensure.IsNotNull(Log, item as ArrayBlock, "item is null or is not ArrayBlock");
            var id    = block.Id;

            CheckIn(id);
        }
 public void Release(IArrayBlock item)
 {
     LeakStatus--;
     this.CheckDisposed();
 }
Esempio n. 4
0
        /// <summary>
        /// Indicates whether the current object is equal to another object.
        /// The object is equal iff the internal buffer contents and length are the same.
        /// </summary>
        /// <param name="other">An object to compare with this object.</param>
        /// <returns>
        /// true if the current object is equal to the <paramref name="other"/> parameter; 
        /// otherwise, false.
        /// </returns>
        public bool Equals(IArrayBlock other)
        {
            if (ReferenceEquals(other, null))
            {
                return false;
            }

            if (!ReferenceEquals(other, this))
            {
                if (this.Length != other.Length)
                {
                    return false;
                }

                for (var i = 0; i < this.Length; i++)
                {
                    if (this[i] != other[i])
                    {
                        return false;
                    }
                }
            }

            return true;
        }
        public void Release(IArrayBlock item)
        {
            CheckDisposed();

            LeakStatus--;
            var block = Ensure.IsNotNull(Log, item as ArrayBlock, "item is null or is not ArrayBlock");
            var id = block.Id;
            CheckIn(id);
        }
 public void Release(IArrayBlock item)
 {
     LeakStatus--;
     this.CheckDisposed();
 }