122 references to Length
Microsoft.CodeAnalysis (116)
ArraySortHelper.cs (2)
82
Debug.Assert(index >= 0 && length >= 0 && (array.
Length
- index >= length), "Check the arguments in the caller!");
338
Debug.Assert(index >= 0 && length >= 0 && (array.
Length
- index >= length), "Check the arguments in the caller!");
SegmentedArray.cs (30)
33
if (length > sourceArray.
Length
)
35
if (length > destinationArray.
Length
)
53
if (length > sourceArray.
Length
)
79
if ((uint)(sourceIndex + length) > sourceArray.
Length
)
81
if ((uint)(destinationIndex + length) > destinationArray.
Length
)
109
Debug.Assert((uint)(sourceIndex + length) <= array.
Length
);
110
Debug.Assert((uint)(destinationIndex + length) <= array.
Length
);
148
if ((uint)(sourceIndex + length) > sourceArray.
Length
)
168
return BinarySearch(array, 0, array.
Length
, value, comparer: null);
173
return BinarySearch(array, 0, array.
Length
, value, comparer);
187
if (array.
Length
- index < length)
195
return IndexOf(array, value, 0, array.
Length
, comparer: null);
200
return IndexOf(array, value, startIndex, array.
Length
- startIndex, comparer: null);
210
if ((uint)startIndex > (uint)array.
Length
)
215
if ((uint)count > (uint)(array.
Length
- startIndex))
260
return LastIndexOf(array, value, array.
Length
- 1, array.
Length
, comparer: null);
265
return LastIndexOf(array, value, startIndex, array.
Length
== 0 ? 0 : startIndex + 1, comparer: null);
275
if (array.
Length
== 0)
294
if ((uint)startIndex >= (uint)array.
Length
)
329
Reverse(array, 0, array.
Length
);
338
if (array.
Length
- index < length)
358
if (array.
Length
> 1)
360
var segment = new SegmentedArraySegment<T>(array, 0, array.
Length
);
372
Sort(array, 0, array.
Length
, comparer);
381
if (array.
Length
- index < length)
398
if (array.
Length
> 1)
400
var segment = new SegmentedArraySegment<T>(array, 0, array.
Length
);
658
_length = array.
Length
;
663
if (offset < 0 || length < 0 || (uint)(offset + length) > (uint)array.
Length
)
SegmentedArray`1.cs (13)
125
int ICollection.Count =>
Length
;
127
int ICollection<T>.Count =>
Length
;
129
int IReadOnlyCollection<T>.Count =>
Length
;
153
return new SegmentedArray<T>(
Length
, items);
314
||
Length
!= o.
Length
)
319
for (var i = 0; i <
Length
; i++)
340
if (
Length
!= o.
Length
)
343
for (var i = 0; i <
Length
; i++)
359
for (var i =
Length
>= 8 ?
Length
- 8 : 0; i <
Length
; i++)
SegmentedDictionary`2.cs (33)
236
Debug.Assert(_buckets.
Length
> 0, "_buckets should be non-empty");
237
Debug.Assert(_entries.
Length
> 0, "_entries should be non-empty");
239
SegmentedArray.Clear(_buckets, 0, _buckets.
Length
);
335
if (_buckets.
Length
> 0)
337
Debug.Assert(_entries.
Length
> 0, "expected entries to be non-empty");
354
if ((uint)i >= (uint)entries.
Length
)
368
} while (collisionCount <= (uint)entries.
Length
);
386
if ((uint)i >= (uint)entries.
Length
)
400
} while (collisionCount <= (uint)entries.
Length
);
418
if ((uint)i >= (uint)entries.
Length
)
432
} while (collisionCount <= (uint)entries.
Length
);
475
if (_buckets.
Length
== 0)
479
Debug.Assert(_buckets.
Length
> 0);
482
Debug.Assert(entries.
Length
> 0, "expected entries to be non-empty");
500
if ((uint)i >= (uint)entries.
Length
)
524
if (collisionCount > (uint)entries.
Length
)
542
if ((uint)i >= (uint)entries.
Length
)
566
if (collisionCount > (uint)entries.
Length
)
581
if ((uint)i >= (uint)entries.
Length
)
605
if (collisionCount > (uint)entries.
Length
)
625
if (count == entries.
Length
)
650
Debug.Assert(_entries.
Length
> 0, "_entries should be non-empty");
651
Debug.Assert(newSize >= _entries.
Length
);
685
if (_buckets.
Length
> 0)
687
Debug.Assert(_entries.
Length
> 0, "entries should be non-empty");
735
if (collisionCount > (uint)entries.
Length
)
757
if (_buckets.
Length
> 0)
759
Debug.Assert(_entries.
Length
> 0, "entries should be non-empty");
809
if (collisionCount > (uint)entries.
Length
)
927
var currentCapacity = _entries.
Length
;
935
if (_buckets.
Length
== 0)
976
var currentCapacity = oldEntries.
Length
;
1120
return ref buckets[(int)HashHelpers.FastMod(hashCode, (uint)buckets.
Length
, _fastModMultiplier)];
SegmentedHashSet`1.cs (29)
114
if (_count > 0 && _entries.
Length
/ _count > ShrinkThreshold)
145
var capacity = source._buckets.
Length
;
187
Debug.Assert(_buckets.
Length
> 0, "_buckets should be non-empty");
188
Debug.Assert(_entries.
Length
> 0, "_entries should be non-empty");
190
SegmentedArray.Clear(_buckets, 0, _buckets.
Length
);
207
if (buckets.
Length
> 0)
210
Debug.Assert(entries.
Length
> 0, "Expected _entries to be initialized");
232
if (collisionCount > (uint)entries.
Length
)
255
if (collisionCount > (uint)entries.
Length
)
277
if (collisionCount > (uint)entries.
Length
)
294
return ref buckets[(int)HashHelpers.FastMod((uint)hashCode, (uint)buckets.
Length
, _fastModMultiplier)];
299
if (_buckets.
Length
> 0)
302
Debug.Assert(entries.
Length
> 0, "entries should be non-empty");
345
if (collisionCount > (uint)entries.
Length
)
393
if (_buckets.
Length
> 0)
861
var currentCapacity = _entries.
Length
;
867
if (_buckets.
Length
== 0)
881
Debug.Assert(_entries.
Length
> 0, "_entries should be non-empty");
882
Debug.Assert(newSize >= _entries.
Length
);
916
var currentCapacity = oldEntries.
Length
;
977
if (_buckets.
Length
== 0)
981
Debug.Assert(_buckets.
Length
> 0);
984
Debug.Assert(entries.
Length
> 0, "expected entries to be non-empty");
1011
if (collisionCount > (uint)entries.
Length
)
1034
if (collisionCount > (uint)entries.
Length
)
1058
if (collisionCount > (uint)entries.
Length
)
1077
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");
SegmentedList`1.cs (9)
124
get => _items.
Length
;
132
if (value != _items.
Length
)
226
if ((uint)size < (uint)array.
Length
)
427
if (_items.
Length
< min)
429
var newCapacity = _items.
Length
== 0 ? DefaultCapacity : _items.
Length
* 2;
711
if (_size == _items.
Length
)
778
SegmentedArray.Copy(array, 0, _items, index, array.
Length
);
1140
var threshold = (int)(_items.
Length
* 0.9);
Microsoft.CodeAnalysis.UnitTests (6)
Collections\SegmentedArrayTests.cs (6)
34
for (var i = 0; i < array.
Length
; i++)
49
Assert.Equal(0, data.
Length
);
107
Assert.Equal(length, data.
Length
);
128
Assert.Equal(length, data.
Length
);
197
for (var i = 0; i < data.
Length
; i++)
209
Assert.Equal(data.
Length
, index);