ExposedList: spaces to tabs

This commit is contained in:
ZimM 2015-02-28 03:13:12 +02:00
parent 0df69e04fd
commit c7644ec0ad

View File

@ -44,7 +44,7 @@ namespace Spine {
private const int DefaultCapacity = 4;
private static readonly T[] EmptyArray = new T[0];
private int _version;
private int version;
public ExposedList() {
Items = EmptyArray;
@ -81,10 +81,10 @@ namespace Spine {
if (Count == Items.Length)
GrowIfNeeded(1);
Items[Count ++] = item;
_version++;
version++;
}
private void GrowIfNeeded(int newCount) {
public void GrowIfNeeded(int newCount) {
int minimumSize = Count + newCount;
if (minimumSize > Items.Length)
Capacity = Math.Max(Math.Max(Capacity * 2, DefaultCapacity), minimumSize);
@ -125,7 +125,7 @@ namespace Spine {
AddCollection(c);
else
AddEnumerable(collection);
_version++;
version++;
}
public int BinarySearch(T item) {
@ -141,10 +141,10 @@ namespace Spine {
return Array.BinarySearch<T>(Items, index, count, item, comparer);
}
public void Clear() {
public void Clear(bool clearArray = true) {
Array.Clear(Items, 0, Items.Length);
Count = 0;
_version++;
version++;
}
public bool Contains(T item) {
@ -327,7 +327,7 @@ namespace Spine {
GrowIfNeeded(1);
Shift(index, 1);
Items[index] = item;
_version++;
version++;
}
private void CheckCollection(IEnumerable<T> collection) {
@ -351,7 +351,7 @@ namespace Spine {
else
InsertEnumeration(index, collection);
}
_version++;
version++;
}
private void InsertCollection(int index, ICollection<T> collection) {
@ -410,7 +410,7 @@ namespace Spine {
if (i == Count)
return 0;
_version++;
version++;
// Remove any additional items
for (j = i + 1; j < Count; j++) {
@ -429,7 +429,7 @@ namespace Spine {
throw new ArgumentOutOfRangeException("index");
Shift(index, -1);
Array.Clear(Items, Count, 1);
_version++;
version++;
}
public void RemoveRange(int index, int count) {
@ -437,40 +437,40 @@ namespace Spine {
if (count > 0) {
Shift(index, -count);
Array.Clear(Items, Count, count);
_version++;
version++;
}
}
public void Reverse() {
Array.Reverse(Items, 0, Count);
_version++;
version++;
}
public void Reverse(int index, int count) {
CheckRange(index, count);
Array.Reverse(Items, index, count);
_version++;
version++;
}
public void Sort() {
Array.Sort<T>(Items, 0, Count, Comparer<T>.Default);
_version++;
version++;
}
public void Sort(IComparer<T> comparer) {
Array.Sort<T>(Items, 0, Count, comparer);
_version++;
version++;
}
public void Sort(Comparison<T> comparison) {
Array.Sort<T>(Items, comparison);
_version++;
version++;
}
public void Sort(int index, int count, IComparer<T> comparer) {
CheckRange(index, count);
Array.Sort<T>(Items, index, count, comparer);
_version++;
version++;
}
public T[] ToArray() {
@ -529,7 +529,7 @@ namespace Spine {
internal Enumerator(ExposedList<T> l)
: this() {
this.l = l;
ver = l._version;
ver = l.version;
}
public void Dispose() {
@ -539,7 +539,7 @@ namespace Spine {
private void VerifyState() {
if (l == null)
throw new ObjectDisposedException(GetType().FullName);
if (ver != l._version)
if (ver != l.version)
throw new InvalidOperationException(
"Collection was modified; enumeration operation may not execute.");
}