Skip to content

Commit 3b1944c

Browse files
committed
Closes #2
1 parent 2e08977 commit 3b1944c

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

Arrays/ArrayString.cs

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,22 @@
1-
namespace Platform.Collections.Arrays
1+
using Platform.Collections.Segments;
2+
3+
namespace Platform.Collections.Arrays
24
{
3-
public class ArrayString<T>
5+
public class ArrayString<T> : Segment<T>
46
{
5-
public readonly T[] Array;
6-
public long Length;
7-
8-
public ArrayString(long length)
9-
: this(new T[length], length)
7+
public ArrayString(int length)
8+
: base(new T[length], 0, length)
109
{
1110
}
1211

1312
public ArrayString(T[] array)
14-
: this(array, array.Length)
15-
{
16-
}
17-
18-
public ArrayString(T[] array, long length)
13+
: base(array, 0, array.Length)
1914
{
20-
Array = array;
21-
Length = length;
2215
}
2316

24-
public bool Contains(T value)
17+
public ArrayString(T[] array, int length)
18+
: base(array, 0, length)
2519
{
26-
var index = System.Array.IndexOf(Array, value);
27-
return index >= 0 && index < Length;
2820
}
2921
}
3022
}

0 commit comments

Comments
 (0)