121 references to Length
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (121)
src\Dependencies\Collections\Internal\ArraySortHelper.cs (2)
86Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 343Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
src\Dependencies\Collections\Segmented\SegmentedArray.cs (31)
22=> Clear(array, 0, array.Length); 41if (length > sourceArray.Length) 43if (length > destinationArray.Length) 61if (length > sourceArray.Length) 87if ((uint)(sourceIndex + length) > sourceArray.Length) 89if ((uint)(destinationIndex + length) > destinationArray.Length) 117Debug.Assert((uint)(sourceIndex + length) <= array.Length); 118Debug.Assert((uint)(destinationIndex + length) <= array.Length); 156if ((uint)(sourceIndex + length) > sourceArray.Length) 176return BinarySearch(array, 0, array.Length, value, comparer: null); 181return BinarySearch(array, 0, array.Length, value, comparer); 195if (array.Length - index < length) 203return IndexOf(array, value, 0, array.Length, comparer: null); 208return IndexOf(array, value, startIndex, array.Length - startIndex, comparer: null); 218if ((uint)startIndex > (uint)array.Length) 223if ((uint)count > (uint)(array.Length - startIndex)) 268return LastIndexOf(array, value, array.Length - 1, array.Length, comparer: null); 273return LastIndexOf(array, value, startIndex, array.Length == 0 ? 0 : startIndex + 1, comparer: null); 283if (array.Length == 0) 302if ((uint)startIndex >= (uint)array.Length) 337Reverse(array, 0, array.Length); 346if (array.Length - index < length) 366if (array.Length > 1) 368var segment = new SegmentedArraySegment<T>(array, 0, array.Length); 380Sort(array, 0, array.Length, comparer); 389if (array.Length - index < length) 406if (array.Length > 1) 408var segment = new SegmentedArraySegment<T>(array, 0, array.Length); 666_length = array.Length; 671if (offset < 0 || length < 0 || (uint)(offset + length) > (uint)array.Length)
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (13)
124int ICollection.Count => Length; 126int ICollection<T>.Count => Length; 128int IReadOnlyCollection<T>.Count => Length; 152return new SegmentedArray<T>(Length, items); 313|| Length != o.Length) 318for (var i = 0; i < Length; i++) 339if (Length != o.Length) 342for (var i = 0; i < Length; i++) 358for (var i = Length >= 8 ? Length - 8 : 0; i < Length; i++)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (29)
168Debug.Assert(_entries.Length >= source.Count); 301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 302Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 406if (_buckets.Length > 0) 408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 425if ((uint)i >= (uint)entries.Length) 439} while (collisionCount <= (uint)entries.Length); 457if ((uint)i >= (uint)entries.Length) 471} while (collisionCount <= (uint)entries.Length); 514if (_buckets.Length == 0) 518Debug.Assert(_buckets.Length > 0); 521Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 540if ((uint)i >= (uint)entries.Length) 564if (collisionCount > (uint)entries.Length) 579if ((uint)i >= (uint)entries.Length) 603if (collisionCount > (uint)entries.Length) 623if (count == entries.Length) 648Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 649Debug.Assert(newSize >= _entries.Length); 705if (_buckets.Length > 0) 707Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 760if (collisionCount > (uint)entries.Length) 782if (_buckets.Length > 0) 784Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 839if (collisionCount > (uint)entries.Length) 957var currentCapacity = _entries.Length; 965if (_buckets.Length == 0) 1006var currentCapacity = oldEntries.Length; 1156return ref buckets[(int)HashHelpers.FastMod(hashCode, (uint)buckets.Length, _fastModMultiplier)];
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (26)
131if (_count > 0 && _entries.Length / _count > ShrinkThreshold) 162var capacity = source._buckets.Length; 204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 205Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 224if (buckets.Length > 0) 227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 249if (collisionCount > (uint)entries.Length) 271if (collisionCount > (uint)entries.Length) 288return ref buckets[(int)HashHelpers.FastMod((uint)hashCode, (uint)buckets.Length, _fastModMultiplier)]; 293if (_buckets.Length > 0) 296Debug.Assert(entries.Length > 0, "entries should be non-empty"); 345if (collisionCount > (uint)entries.Length) 400if (_buckets.Length > 0) 881var currentCapacity = _entries.Length; 887if (_buckets.Length == 0) 901Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 902Debug.Assert(newSize >= _entries.Length); 958var currentCapacity = oldEntries.Length; 1019if (_buckets.Length == 0) 1023Debug.Assert(_buckets.Length > 0); 1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1054if (collisionCount > (uint)entries.Length) 1078if (collisionCount > (uint)entries.Length) 1097if (count == entries.Length) 1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (20)
128get => _items.Length; 136if (value == _items.Length) 145if (_items.Length == 0) 255if ((uint)size < (uint)array.Length) 270Debug.Assert(_size == _items.Length); 309if (_items.Length - _size < count) 320SegmentedArray.Copy(array, 0, _items, _size, array.Length); 506if (_items.Length < capacity) 511return _items.Length; 520Debug.Assert(_items.Length < capacity); 524if (_items.Length < SegmentedArrayHelper.GetSegmentSize<T>() / 2) 528newCapacity = _items.Length == 0 ? DefaultCapacity : _items.Length * 2; 530else if (_items.Length < SegmentedArrayHelper.GetSegmentSize<T>()) 538if (0 == (_items.Length & SegmentedArrayHelper.GetOffsetMask<T>())) 545var oldSegmentCount = (_items.Length + SegmentedArrayHelper.GetSegmentSize<T>() - 1) >> SegmentedArrayHelper.GetSegmentShift<T>(); 862if (_size == _items.Length) 909if (_items.Length - _size < count) 932SegmentedArray.Copy(array, 0, _items, index, array.Length); 1295var threshold = (int)(_items.Length * 0.9);