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