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