125 references to Length
Microsoft.CodeAnalysis.Workspaces (125)
src\Dependencies\Collections\Internal\ArraySortHelper.cs (2)
84Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 341Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
src\Dependencies\Collections\SegmentedArray.cs (31)
20=> Clear(array, 0, array.Length); 39if (length > sourceArray.Length) 41if (length > destinationArray.Length) 59if (length > sourceArray.Length) 85if ((uint)(sourceIndex + length) > sourceArray.Length) 87if ((uint)(destinationIndex + length) > destinationArray.Length) 115Debug.Assert((uint)(sourceIndex + length) <= array.Length); 116Debug.Assert((uint)(destinationIndex + length) <= array.Length); 154if ((uint)(sourceIndex + length) > sourceArray.Length) 174return BinarySearch(array, 0, array.Length, value, comparer: null); 179return BinarySearch(array, 0, array.Length, value, comparer); 193if (array.Length - index < length) 201return IndexOf(array, value, 0, array.Length, comparer: null); 206return IndexOf(array, value, startIndex, array.Length - startIndex, comparer: null); 216if ((uint)startIndex > (uint)array.Length) 221if ((uint)count > (uint)(array.Length - startIndex)) 266return LastIndexOf(array, value, array.Length - 1, array.Length, comparer: null); 271return LastIndexOf(array, value, startIndex, array.Length == 0 ? 0 : startIndex + 1, comparer: null); 281if (array.Length == 0) 300if ((uint)startIndex >= (uint)array.Length) 335Reverse(array, 0, array.Length); 344if (array.Length - index < length) 364if (array.Length > 1) 366var segment = new SegmentedArraySegment<T>(array, 0, array.Length); 378Sort(array, 0, array.Length, comparer); 387if (array.Length - index < length) 404if (array.Length > 1) 406var segment = new SegmentedArraySegment<T>(array, 0, array.Length); 664_length = array.Length; 669if (offset < 0 || length < 0 || (uint)(offset + length) > (uint)array.Length)
src\Dependencies\Collections\SegmentedArray`1.cs (13)
122int ICollection.Count => Length; 124int ICollection<T>.Count => Length; 126int IReadOnlyCollection<T>.Count => Length; 150return new SegmentedArray<T>(Length, items); 311|| Length != o.Length) 316for (var i = 0; i < Length; i++) 337if (Length != o.Length) 340for (var i = 0; i < Length; i++) 356for (var i = Length >= 8 ? Length - 8 : 0; i < Length; i++)
src\Dependencies\Collections\SegmentedDictionary`2.cs (29)
166Debug.Assert(_entries.Length >= source.Count); 299Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 300Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 404if (_buckets.Length > 0) 406Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 423if ((uint)i >= (uint)entries.Length) 437} while (collisionCount <= (uint)entries.Length); 455if ((uint)i >= (uint)entries.Length) 469} while (collisionCount <= (uint)entries.Length); 512if (_buckets.Length == 0) 516Debug.Assert(_buckets.Length > 0); 519Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 538if ((uint)i >= (uint)entries.Length) 562if (collisionCount > (uint)entries.Length) 577if ((uint)i >= (uint)entries.Length) 601if (collisionCount > (uint)entries.Length) 621if (count == entries.Length) 646Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 647Debug.Assert(newSize >= _entries.Length); 703if (_buckets.Length > 0) 705Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 758if (collisionCount > (uint)entries.Length) 780if (_buckets.Length > 0) 782Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 837if (collisionCount > (uint)entries.Length) 955var currentCapacity = _entries.Length; 963if (_buckets.Length == 0) 1004var currentCapacity = oldEntries.Length; 1154return ref buckets[(int)HashHelpers.FastMod(hashCode, (uint)buckets.Length, _fastModMultiplier)];
src\Dependencies\Collections\SegmentedHashSet`1.cs (26)
129if (_count > 0 && _entries.Length / _count > ShrinkThreshold) 160var capacity = source._buckets.Length; 202Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 203Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 222if (buckets.Length > 0) 225Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 247if (collisionCount > (uint)entries.Length) 269if (collisionCount > (uint)entries.Length) 286return ref buckets[(int)HashHelpers.FastMod((uint)hashCode, (uint)buckets.Length, _fastModMultiplier)]; 291if (_buckets.Length > 0) 294Debug.Assert(entries.Length > 0, "entries should be non-empty"); 343if (collisionCount > (uint)entries.Length) 398if (_buckets.Length > 0) 879var currentCapacity = _entries.Length; 885if (_buckets.Length == 0) 899Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 900Debug.Assert(newSize >= _entries.Length); 956var currentCapacity = oldEntries.Length; 1017if (_buckets.Length == 0) 1021Debug.Assert(_buckets.Length > 0); 1024Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1052if (collisionCount > (uint)entries.Length) 1076if (collisionCount > (uint)entries.Length) 1095if (count == entries.Length) 1170Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1327Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\Dependencies\Collections\SegmentedList`1.cs (20)
126get => _items.Length; 134if (value == _items.Length) 143if (_items.Length == 0) 253if ((uint)size < (uint)array.Length) 268Debug.Assert(_size == _items.Length); 307if (_items.Length - _size < count) 318SegmentedArray.Copy(array, 0, _items, _size, array.Length); 504if (_items.Length < capacity) 509return _items.Length; 518Debug.Assert(_items.Length < capacity); 522if (_items.Length < SegmentedArrayHelper.GetSegmentSize<T>() / 2) 526newCapacity = _items.Length == 0 ? DefaultCapacity : _items.Length * 2; 528else if (_items.Length < SegmentedArrayHelper.GetSegmentSize<T>()) 536if (0 == (_items.Length & SegmentedArrayHelper.GetOffsetMask<T>())) 543var oldSegmentCount = (_items.Length + SegmentedArrayHelper.GetSegmentSize<T>() - 1) >> SegmentedArrayHelper.GetSegmentShift<T>(); 860if (_size == _items.Length) 907if (_items.Length - _size < count) 930SegmentedArray.Copy(array, 0, _items, index, array.Length); 1293var threshold = (int)(_items.Length * 0.9);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\ImmutableIntervalTree`1.cs (4)
214if (currentNodeIndex >= array.Length) 299return tree._array.Length > 0; 305return leftNode < tree._array.Length; 311return rightNode < tree._array.Length;