Add IndexOutOfRangeException to CyclycArray indexer.

This commit is contained in:
ngfrolov 2022-11-17 17:25:05 +05:00
parent 013e643da5
commit 1c4a2f7922

View File

@ -91,7 +91,7 @@ namespace System.Collections.Generic
get
{
if (used == 0)
return default;
throw new IndexOutOfRangeException();
var i = (current + 1 + index) % used;
return array[i];