From 0c59d5ff80a033411048a30aa35eaf2f2e29f78e Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Sun, 3 Nov 2019 22:06:09 -0500 Subject: [PATCH] Simplify Array.Copy(a, 0, b, 0, c) to Array.Copy(a, b, c) VS regex search and replace from `Array.Copy\((.+), 0, (.+), 0` to `Array.Copy($1, $2`, then manually reviewed. The only changes I reverted were those to the tests for Array itself. --- .../Windows/BCrypt/BCryptAlgorithmCache.cs | 2 +- .../System/Collections/Generic/ArrayBuilder.cs | 4 ++-- .../Generic/LargeArrayBuilder.SpeedOpt.cs | 2 +- src/Common/tests/StaticTestGenerator/Program.cs | 2 +- src/Common/tests/System/Collections/IListTest.cs | 8 ++++---- src/Common/tests/System/Collections/Utils.cs | 2 +- src/Common/tests/Tests/System/StringTests.cs | 2 +- .../CSharp/RuntimeBinder/Errors/ErrorHandling.cs | 2 +- .../RuntimeBinder/Semantics/Types/TypeArray.cs | 2 +- .../RuntimeBinder/Semantics/Types/TypeManager.cs | 2 +- .../Collections/Concurrent/ConcurrentBag.cs | 2 +- .../Concurrent/ConcurrentDictionary.cs | 2 +- .../Collections/Immutable/ImmutableArray.cs | 2 +- .../Immutable/ImmutableArray_1.Builder.cs | 4 ++-- .../Collections/Immutable/ImmutableArray_1.cs | 12 ++++++------ .../src/System/Collections/SortedList.cs | 8 ++++---- .../src/System/Collections/Stack.cs | 4 ++-- .../src/System/Collections/BitArray.cs | 4 ++-- .../src/System/Collections/Generic/HashSet.cs | 2 +- .../src/System/Collections/Generic/SortedList.cs | 4 ++-- .../LinkedList.Generic.Tests.AddAfter.cs | 16 ++++++++-------- .../LinkedList.Generic.Tests.AddBefore.cs | 12 ++++++------ .../LinkedList.Generic.Tests.AddFirst.cs | 8 ++++---- .../LinkedList.Generic.Tests.AddLast.cs | 8 ++++---- .../LinkedList/LinkedList.Generic.Tests.Find.cs | 6 +++--- .../LinkedList.Generic.Tests.FindLast.cs | 4 ++-- .../LinkedList.Generic.Tests.RemoveLast.cs | 4 ++-- .../LinkedList.Generic.Tests.RemoveNode.cs | 2 +- .../LinkedList/LinkedList.Generic.Tests.cs | 2 +- .../DataAnnotations/UIHintAttribute.cs | 2 +- .../Composition/Hosting/AtomicComposition.cs | 2 +- .../System/ComponentModel/AttributeCollection.cs | 2 +- .../src/System/ComponentModel/Container.cs | 2 +- .../ComponentModel/CultureInfoConverter.cs | 2 +- .../ComponentModel/EventDescriptorCollection.cs | 4 ++-- .../System/ComponentModel/PropertyDescriptor.cs | 4 ++-- .../PropertyDescriptorCollection.cs | 8 ++++---- ...tTypeDescriptionProvider.ReflectedTypeData.cs | 4 ++-- .../ReflectTypeDescriptionProvider.cs | 4 ++-- .../src/System/ComponentModel/TypeDescriptor.cs | 2 +- .../System/ComponentModel/TypeListConverter.cs | 2 +- .../src/System/Data/ColumnTypeConverter.cs | 2 +- .../src/System/Data/Common/BigIntegerStorage.cs | 2 +- .../src/System/Data/Common/BooleanStorage.cs | 2 +- .../src/System/Data/Common/ByteStorage.cs | 2 +- .../src/System/Data/Common/CharStorage.cs | 2 +- .../System/Data/Common/DateTimeOffsetStorage.cs | 2 +- .../src/System/Data/Common/DateTimeStorage.cs | 2 +- .../Data/Common/DbConnectionStringBuilder.cs | 2 +- .../src/System/Data/Common/DbDataAdapter.cs | 2 +- .../src/System/Data/Common/DecimalStorage.cs | 2 +- .../src/System/Data/Common/DoubleStorage.cs | 2 +- .../src/System/Data/Common/Int16Storage.cs | 2 +- .../src/System/Data/Common/Int32Storage.cs | 2 +- .../src/System/Data/Common/Int64Storage.cs | 2 +- .../src/System/Data/Common/ObjectStorage.cs | 2 +- .../src/System/Data/Common/SByteStorage.cs | 2 +- .../Data/Common/SQLTypes/SQLBinaryStorage.cs | 2 +- .../Data/Common/SQLTypes/SQLByteStorage.cs | 2 +- .../Data/Common/SQLTypes/SQLBytesStorage.cs | 2 +- .../Data/Common/SQLTypes/SQLCharsStorage.cs | 2 +- .../Data/Common/SQLTypes/SQLDateTimeStorage.cs | 2 +- .../Data/Common/SQLTypes/SQLDecimalStorage.cs | 2 +- .../Data/Common/SQLTypes/SQLDoubleStorage.cs | 2 +- .../Data/Common/SQLTypes/SQLGuidStorage.cs | 2 +- .../Data/Common/SQLTypes/SQLInt16Storage.cs | 2 +- .../Data/Common/SQLTypes/SQLInt32Storage.cs | 2 +- .../Data/Common/SQLTypes/SQLInt64Storage.cs | 2 +- .../Data/Common/SQLTypes/SQLMoneyStorage.cs | 2 +- .../Data/Common/SQLTypes/SQLSingleStorage.cs | 2 +- .../Data/Common/SQLTypes/SQLStringStorage.cs | 2 +- .../Data/Common/SQLTypes/SQlBooleanStorage.cs | 2 +- .../src/System/Data/Common/SingleStorage.cs | 2 +- .../src/System/Data/Common/SqlUDTStorage.cs | 2 +- .../src/System/Data/Common/StringStorage.cs | 2 +- .../src/System/Data/Common/TimeSpanStorage.cs | 2 +- .../src/System/Data/Common/UInt16Storage.cs | 2 +- .../src/System/Data/Common/UInt32Storage.cs | 2 +- .../src/System/Data/Common/UInt64Storage.cs | 2 +- .../src/System/Data/DataError.cs | 2 +- .../src/System/Data/DataTable.cs | 2 +- .../src/System/Data/Filter/FunctionNode.cs | 2 +- .../System/Data/ProviderBase/SchemaMapping.cs | 2 +- src/System.Data.Common/src/System/Data/RbTree.cs | 4 ++-- .../src/System/Data/RecordManager.cs | 2 +- .../src/System/Data/SQLTypes/SQLBytes.cs | 2 +- .../src/System/Data/SQLTypes/SQLChars.cs | 2 +- .../SqlServer/Server/SqlRecordBuffer.cs | 2 +- .../src/System/Data/SqlClient/TdsParser.cs | 2 +- .../src/System/Diagnostics/EventLog.cs | 2 +- .../System/Diagnostics/PerformanceCounterLib.cs | 6 +++--- .../System/Diagnostics/ProcessManager.Windows.cs | 2 +- .../AccountManagement/AD/ADStoreKey.cs | 2 +- .../AccountManagement/SAM/SAMStoreKey.cs | 2 +- .../DeflateManaged/InflaterManaged.cs | 2 +- .../src/System/IO/Pipelines/PipeCompletion.cs | 2 +- .../tests/SerialPort/DiscardNull.cs | 2 +- src/System.IO.Ports/tests/SerialPort/ReadChar.cs | 2 +- .../tests/SerialPort/ReadExisting.cs | 2 +- .../tests/SerialPort/Read_char_int_int.cs | 8 ++++---- .../tests/SerialPort/ReceivedEvent.cs | 2 +- .../src/System/Dynamic/ExpandoClass.cs | 2 +- .../src/System/Dynamic/ExpandoObject.cs | 2 +- .../System/Dynamic/Utils/CollectionExtensions.cs | 2 +- .../ReadOnlyCollectionBuilder.cs | 4 ++-- .../System/Runtime/CompilerServices/RuleCache.cs | 2 +- .../Parallel/Channels/AsynchronousChannel.cs | 2 +- .../src/System/Linq/Parallel/Helpers.cs | 2 +- .../src/System/Linq/Parallel/Utils/HashLookup.cs | 2 +- .../src/System/Linq/Parallel/Utils/Sorting.cs | 2 +- src/System.Linq/src/System/Linq/Set.cs | 2 +- .../tests/FunctionalTests/HttpContentTest.cs | 2 +- .../tests/GenericVectorTests.cs | 6 +++--- .../Runtime/Serialization/ClassDataContract.cs | 8 ++++---- .../Runtime/Serialization/ExtensionDataReader.cs | 4 ++-- .../Runtime/Serialization/Json/XmlJsonReader.cs | 2 +- .../Runtime/Serialization/Json/XmlJsonWriter.cs | 2 +- .../XmlObjectSerializerReadContext.cs | 4 ++-- .../src/System/Xml/XmlBaseReader.cs | 8 ++++---- .../src/System/Xml/XmlBaseWriter.cs | 6 +++--- .../src/System/Xml/XmlBinaryReaderSession.cs | 2 +- .../src/System/Xml/XmlBinaryWriterSession.cs | 2 +- .../src/System/Xml/XmlCanonicalWriter.cs | 6 +++--- .../src/System/Xml/BinaryXml/XmlBinaryReader.cs | 8 ++++---- .../src/System/Xml/BitStack.cs | 2 +- .../System/Xml/Core/XmlEncodedRawTextWriter.cs | 2 +- .../src/System/Xml/Core/XmlSubtreeReader.cs | 2 +- .../src/System/Xml/Core/XmlTextReaderImpl.cs | 4 ++-- .../src/System/Xml/Core/XmlTextWriter.cs | 4 ++-- .../src/System/Xml/Core/XmlWellFormedWriter.cs | 6 +++--- .../System/Xml/Core/XmlWellFormedWriterAsync.cs | 2 +- .../Xml/Core/XmlWellFormedWriterHelpers.cs | 2 +- .../src/System/Xml/Core/XsdCachingReader.cs | 4 ++-- .../src/System/Xml/Core/XsdValidatingReader.cs | 2 +- .../System/Xml/Dom/DocumentSchemaValidator.cs | 2 +- src/System.Private.Xml/src/System/Xml/HWStack.cs | 2 +- .../System/Xml/Resolvers/XmlPreloadedResolver.cs | 2 +- .../src/System/Xml/Schema/BitSet.cs | 2 +- .../src/System/Xml/Schema/ContentValidator.cs | 4 ++-- .../src/System/Xml/Schema/DtdParser.cs | 2 +- .../src/System/Xml/Schema/DtdParserAsync.cs | 2 +- .../src/System/Xml/Serialization/Mappings.cs | 4 ++-- .../XmlSerializationGeneratedCode.cs | 2 +- .../Xml/Serialization/XmlSerializationILGen.cs | 4 ++-- .../src/System/Xml/XmlNamespacemanager.cs | 2 +- .../src/System/Xml/Xsl/QIL/QilList.cs | 2 +- .../System/Xml/Xsl/Runtime/XmlAttributeCache.cs | 2 +- .../System/Xml/Xsl/Runtime/XmlNavigatorStack.cs | 2 +- .../System/Xml/Xsl/Runtime/XmlQueryRuntime.cs | 2 +- .../Xml/Xsl/Runtime/XmlSortKeyAccumulator.cs | 2 +- .../System/Xml/Xsl/Xslt/CompilerScopeManager.cs | 2 +- .../System/Xml/Xsl/Xslt/OutputScopeManager.cs | 2 +- .../src/System/Xml/Xsl/Xslt/XsltInput.cs | 2 +- .../src/System/Xml/Xsl/XsltOld/BuilderInfo.cs | 2 +- .../Context/Virtual/VirtualPropertyBase.cs | 2 +- .../tests/Metadata/MetadataReaderTests.cs | 2 +- .../src/System/Numerics/BigInteger.cs | 10 +++++----- .../Numerics/BigIntegerCalculator.BitsBuffer.cs | 2 +- .../Numerics/BigIntegerCalculator.DivRem.cs | 2 +- .../tests/BigInteger/ctor.cs | 4 ++-- .../Runtime/Serialization/FormatterServices.cs | 2 +- .../Formatters/Binary/BinaryObjectReader.cs | 4 ++-- .../Formatters/Binary/BinaryUtilClasses.cs | 10 +++++----- .../Runtime/Serialization/ObjectManager.cs | 10 +++++----- .../CryptoCanonicalization/CanonicalWriter.cs | 4 ++-- .../tests/SerializationTestTypes/DataContract.cs | 2 +- .../tests/SerializationTypes.RuntimeOnly.cs | 2 +- .../Cryptography/TripleDesImplementation.cs | 2 +- .../System/Security/Cryptography/CryptoConfig.cs | 4 ++-- .../tests/HmacTests.cs | 2 +- .../System/Security/Cryptography/TripleDESCng.cs | 2 +- .../src/Internal/Cryptography/PkcsHelpers.cs | 2 +- .../Security/Permissions/PrincipalPermission.cs | 2 +- .../src/System/Text/RegularExpressions/Regex.cs | 2 +- .../Text/RegularExpressions/RegexBoyerMoore.cs | 2 +- .../Text/RegularExpressions/RegexCompiler.cs | 2 +- .../src/System/Collections/Generic/Deque.cs | 2 +- .../src/Internal/ImmutableArray.cs | 4 ++-- .../tests/Task/TaskCancelWaitTest.cs | 2 +- .../src/System/Transactions/Transaction.cs | 2 +- .../System/Transactions/TransactionInterop.cs | 2 +- .../src/System/Web/Util/HttpEncoder.cs | 2 +- .../src/System/Media/SoundPlayer.cs | 2 +- 183 files changed, 277 insertions(+), 277 deletions(-) diff --git a/src/Common/src/Interop/Windows/BCrypt/BCryptAlgorithmCache.cs b/src/Common/src/Interop/Windows/BCrypt/BCryptAlgorithmCache.cs index 89c4f74bc4eb..4c68faa8c187 100644 --- a/src/Common/src/Interop/Windows/BCrypt/BCryptAlgorithmCache.cs +++ b/src/Common/src/Interop/Windows/BCrypt/BCryptAlgorithmCache.cs @@ -40,7 +40,7 @@ public static SafeBCryptAlgorithmHandle GetCachedBCryptAlgorithmHandle(string ha Entry[] newCache = new Entry[cache.Length + 1]; Entry newEntry = new Entry(hashAlgorithmId, flags, safeBCryptAlgorithmHandle); - Array.Copy(cache, 0, newCache, 0, cache.Length); + Array.Copy(cache, newCache, cache.Length); newCache[newCache.Length - 1] = newEntry; // Atomically overwrite the cache with our new cache. It's possible some other thread raced to add a new entry with us - if so, one of the new entries diff --git a/src/Common/src/System/Collections/Generic/ArrayBuilder.cs b/src/Common/src/System/Collections/Generic/ArrayBuilder.cs index 0119e1919801..952dcef800c5 100644 --- a/src/Common/src/System/Collections/Generic/ArrayBuilder.cs +++ b/src/Common/src/System/Collections/Generic/ArrayBuilder.cs @@ -112,7 +112,7 @@ public T[] ToArray() // Avoid a bit of overhead (method call, some branches, extra codegen) // which would be incurred by using Array.Resize result = new T[_count]; - Array.Copy(_array, 0, result, 0, _count); + Array.Copy(_array, result, _count); } #if DEBUG @@ -156,7 +156,7 @@ private void EnsureCapacity(int minimum) T[] next = new T[nextCapacity]; if (_count > 0) { - Array.Copy(_array!, 0, next, 0, _count); + Array.Copy(_array!, next, _count); } _array = next; } diff --git a/src/Common/src/System/Collections/Generic/LargeArrayBuilder.SpeedOpt.cs b/src/Common/src/System/Collections/Generic/LargeArrayBuilder.SpeedOpt.cs index b1b16a8b349f..107b7eb7a9e4 100644 --- a/src/Common/src/System/Collections/Generic/LargeArrayBuilder.SpeedOpt.cs +++ b/src/Common/src/System/Collections/Generic/LargeArrayBuilder.SpeedOpt.cs @@ -308,7 +308,7 @@ private void AllocateBuffer() int nextCapacity = Math.Min(_count == 0 ? StartingCapacity : _count * 2, _maxCapacity); _current = new T[nextCapacity]; - Array.Copy(_first, 0, _current, 0, _count); + Array.Copy(_first, _current, _count); _first = _current; } else diff --git a/src/Common/tests/StaticTestGenerator/Program.cs b/src/Common/tests/StaticTestGenerator/Program.cs index 98c062d31c6a..a5b5f02725fb 100644 --- a/src/Common/tests/StaticTestGenerator/Program.cs +++ b/src/Common/tests/StaticTestGenerator/Program.cs @@ -497,7 +497,7 @@ void WriteArgumentListStatic(object[]? arguments, ParameterInfo[] parameters) else if (arguments.Length < parameters.Length) { var newArguments = new object[parameters.Length]; - Array.Copy(arguments, 0, newArguments, 0, arguments.Length); + Array.Copy(arguments, newArguments, arguments.Length); for (int i = arguments.Length; i < parameters.Length; i++) { if (parameters[i].HasDefaultValue) diff --git a/src/Common/tests/System/Collections/IListTest.cs b/src/Common/tests/System/Collections/IListTest.cs index 21652178f09b..60e6d74a7f90 100644 --- a/src/Common/tests/System/Collections/IListTest.cs +++ b/src/Common/tests/System/Collections/IListTest.cs @@ -477,7 +477,7 @@ public void AddWithNullValueInMiddle() items = new object[sizeWithNull]; list.Add(null); items[sizeWithNull/2] = null; - Array.Copy(tempItems, 0, items, 0, sizeWithNull/2); + Array.Copy(tempItems, items, sizeWithNull/2); Array.Copy( tempItems, sizeWithNull/2, @@ -567,7 +567,7 @@ public void AddDuplicateValue() list.AddRange(tempItems); list.AddRange(tempItems); - Array.Copy(tempItems, 0, items, 0, 16); + Array.Copy(tempItems, items, 16); Array.Copy(tempItems, 0, items, 16, 16); } CollectionAssert.Equal(items, list); @@ -1311,7 +1311,7 @@ public void InsertAndRemove() { object newObject = GenerateItem(); list.Insert(i, newObject); - Array.Copy(items, 0, tempItems, 0, i); + Array.Copy(items, tempItems, i); tempItems[i] = newObject; Array.Copy(items, i, tempItems, i + 1, items.Length - i); CollectionAssert.Equal(tempItems, list); @@ -1533,7 +1533,7 @@ public void RemoveNull() IList list = GetList(null); object[] tempItems = GenerateItems(16); list.AddRange(tempItems); - Array.Copy(tempItems, 0, items, 0, 11); + Array.Copy(tempItems, items, 11); Array.Copy(tempItems, 12, items, 11, 4); list.Insert(8, null); list.Remove(tempItems[11]); diff --git a/src/Common/tests/System/Collections/Utils.cs b/src/Common/tests/System/Collections/Utils.cs index 2d2577bf5cde..d205145fb6bc 100644 --- a/src/Common/tests/System/Collections/Utils.cs +++ b/src/Common/tests/System/Collections/Utils.cs @@ -40,7 +40,7 @@ public static T[] Push(this T[] array, params T[] arguments) public static T[] RemoveAt(this T[] array, int removeIndex) { var ret = new T[array.Length - 1]; - Array.Copy(array, 0, ret, 0, removeIndex); + Array.Copy(array, ret, removeIndex); Array.Copy( array, removeIndex + 1, diff --git a/src/Common/tests/Tests/System/StringTests.cs b/src/Common/tests/Tests/System/StringTests.cs index 00b71e662eea..84c7a69b4805 100644 --- a/src/Common/tests/Tests/System/StringTests.cs +++ b/src/Common/tests/Tests/System/StringTests.cs @@ -7288,7 +7288,7 @@ private static IEnumerable Permute(T[] input) for (int i = 0; i < input.Length; i++) { var remainder = new T[input.Length - 1]; - Array.Copy(input, 0, remainder, 0, i); + Array.Copy(input, remainder, i); Array.Copy(input, i + 1, remainder, i, input.Length - i - 1); foreach (T[] output in Permute(remainder)) { diff --git a/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Errors/ErrorHandling.cs b/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Errors/ErrorHandling.cs index aa786602816b..2e9a9c61ff7d 100644 --- a/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Errors/ErrorHandling.cs +++ b/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Errors/ErrorHandling.cs @@ -61,7 +61,7 @@ public static RuntimeBinderException Error(ErrorCode id, params ErrArg[] args) { // Copy the strings over to another buffer. string[] prgpszNew = new string[cpsz]; - Array.Copy(prgpsz, 0, prgpszNew, 0, cpsz); + Array.Copy(prgpsz, prgpszNew, cpsz); for (int i = 0; i < cpsz; i++) { diff --git a/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/TypeArray.cs b/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/TypeArray.cs index bcbbfa1043a4..7717069fa290 100644 --- a/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/TypeArray.cs +++ b/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/TypeArray.cs @@ -156,7 +156,7 @@ public static TypeArray Concat(TypeArray pta1, TypeArray pta2) } CType[] combined = new CType[prgtype1.Length + prgtype2.Length]; - Array.Copy(prgtype1, 0, combined, 0, prgtype1.Length); + Array.Copy(prgtype1, combined, prgtype1.Length); Array.Copy(prgtype2, 0, combined, prgtype1.Length, prgtype2.Length); return Allocate(combined); } diff --git a/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/TypeManager.cs b/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/TypeManager.cs index 30b480876858..b73880d77a70 100644 --- a/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/TypeManager.cs +++ b/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/TypeManager.cs @@ -211,7 +211,7 @@ public static TypeArray SubstTypeArray(TypeArray taSrc, SubstContext ctx) if (src != dst) { CType[] dsts = new CType[srcs.Length]; - Array.Copy(srcs, 0, dsts, 0, i); + Array.Copy(srcs, dsts, i); dsts[i] = dst; while (++i < srcs.Length) { diff --git a/src/System.Collections.Concurrent/src/System/Collections/Concurrent/ConcurrentBag.cs b/src/System.Collections.Concurrent/src/System/Collections/Concurrent/ConcurrentBag.cs index 3912ac84b643..c7549f677afd 100644 --- a/src/System.Collections.Concurrent/src/System/Collections/Concurrent/ConcurrentBag.cs +++ b/src/System.Collections.Concurrent/src/System/Collections/Concurrent/ConcurrentBag.cs @@ -796,7 +796,7 @@ internal void LocalPush(T item, ref long emptyToNonEmptyListTransitionCount) int headIdx = head & _mask; if (headIdx == 0) { - Array.Copy(_array, 0, newArray, 0, _array.Length); + Array.Copy(_array, newArray, _array.Length); } else { diff --git a/src/System.Collections.Concurrent/src/System/Collections/Concurrent/ConcurrentDictionary.cs b/src/System.Collections.Concurrent/src/System/Collections/Concurrent/ConcurrentDictionary.cs index f2383c73201f..5a0d052819b0 100644 --- a/src/System.Collections.Concurrent/src/System/Collections/Concurrent/ConcurrentDictionary.cs +++ b/src/System.Collections.Concurrent/src/System/Collections/Concurrent/ConcurrentDictionary.cs @@ -1837,7 +1837,7 @@ private void GrowTable(Tables tables) if (_growLockArray && tables._locks.Length < MaxLockNumber) { newLocks = new object[tables._locks.Length * 2]; - Array.Copy(tables._locks, 0, newLocks, 0, tables._locks.Length); + Array.Copy(tables._locks, newLocks, tables._locks.Length); for (int i = tables._locks.Length; i < newLocks.Length; i++) { newLocks[i] = new object(); diff --git a/src/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray.cs b/src/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray.cs index 74246fbab7ee..d11222653b42 100644 --- a/src/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray.cs +++ b/src/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray.cs @@ -557,7 +557,7 @@ internal static ImmutableArray CreateDefensiveCopy(T[] items) // defensive copy var tmp = new T[items.Length]; - Array.Copy(items, 0, tmp, 0, items.Length); + Array.Copy(items, tmp, items.Length); return new ImmutableArray(tmp); } } diff --git a/src/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray_1.Builder.cs b/src/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray_1.Builder.cs index 97712e539701..db94802cb665 100644 --- a/src/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray_1.Builder.cs +++ b/src/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray_1.Builder.cs @@ -68,7 +68,7 @@ public int Capacity var temp = new T[value]; if (_count > 0) { - Array.Copy(_elements, 0, temp, 0, _count); + Array.Copy(_elements, temp, _count); } _elements = temp; @@ -437,7 +437,7 @@ public T[] ToArray() } T[] result = new T[this.Count]; - Array.Copy(_elements, 0, result, 0, this.Count); + Array.Copy(_elements, result, this.Count); return result; } diff --git a/src/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray_1.cs b/src/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray_1.cs index a8aaab4750a3..1805f9b68647 100644 --- a/src/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray_1.cs +++ b/src/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray_1.cs @@ -316,7 +316,7 @@ public ImmutableArray Insert(int index, T item) if (index != 0) { - Array.Copy(self.array, 0, tmp, 0, index); + Array.Copy(self.array, tmp, index); } if (index != self.Length) { @@ -355,7 +355,7 @@ public ImmutableArray InsertRange(int index, IEnumerable items) if (index != 0) { - Array.Copy(self.array, 0, tmp, 0, index); + Array.Copy(self.array, tmp, index); } if (index != self.Length) { @@ -407,7 +407,7 @@ public ImmutableArray InsertRange(int index, ImmutableArray items) if (index != 0) { - Array.Copy(self.array, 0, tmp, 0, index); + Array.Copy(self.array, tmp, index); } if (index != self.Length) { @@ -474,7 +474,7 @@ public ImmutableArray SetItem(int index, T item) Requires.Range(index >= 0 && index < self.Length, nameof(index)); T[] tmp = new T[self.Length]; - Array.Copy(self.array, 0, tmp, 0, self.Length); + Array.Copy(self.array, tmp, self.Length); tmp[index] = item; return new ImmutableArray(tmp); } @@ -580,7 +580,7 @@ public ImmutableArray RemoveRange(int index, int length) } T[] tmp = new T[self.Length - length]; - Array.Copy(self.array, 0, tmp, 0, index); + Array.Copy(self.array, tmp, index); Array.Copy(self.array, index + length, tmp, index, self.Length - index - length); return new ImmutableArray(tmp); } @@ -800,7 +800,7 @@ public ImmutableArray Sort(int index, int count, IComparer comparer) if (outOfOrder) { var tmp = new T[self.Length]; - Array.Copy(self.array, 0, tmp, 0, self.Length); + Array.Copy(self.array, tmp, self.Length); Array.Sort(tmp, index, count, comparer); return new ImmutableArray(tmp); } diff --git a/src/System.Collections.NonGeneric/src/System/Collections/SortedList.cs b/src/System.Collections.NonGeneric/src/System/Collections/SortedList.cs index dc929df49d28..73977bfbf899 100644 --- a/src/System.Collections.NonGeneric/src/System/Collections/SortedList.cs +++ b/src/System.Collections.NonGeneric/src/System/Collections/SortedList.cs @@ -214,8 +214,8 @@ public virtual int Capacity object[] newValues = new object[value]; if (_size > 0) { - Array.Copy(keys, 0, newKeys, 0, _size); - Array.Copy(values, 0, newValues, 0, _size); + Array.Copy(keys, newKeys, _size); + Array.Copy(values, newValues, _size); } keys = newKeys; values = newValues; @@ -301,8 +301,8 @@ public virtual void Clear() public virtual object Clone() { SortedList sl = new SortedList(_size); - Array.Copy(keys, 0, sl.keys, 0, _size); - Array.Copy(values, 0, sl.values, 0, _size); + Array.Copy(keys, sl.keys, _size); + Array.Copy(values, sl.values, _size); sl._size = _size; sl.version = version; sl.comparer = comparer; diff --git a/src/System.Collections.NonGeneric/src/System/Collections/Stack.cs b/src/System.Collections.NonGeneric/src/System/Collections/Stack.cs index b39fe902a62a..d2a65116bec0 100644 --- a/src/System.Collections.NonGeneric/src/System/Collections/Stack.cs +++ b/src/System.Collections.NonGeneric/src/System/Collections/Stack.cs @@ -91,7 +91,7 @@ public virtual object Clone() { Stack s = new Stack(_size); s._size = _size; - Array.Copy(_array, 0, s._array, 0, _size); + Array.Copy(_array, s._array, _size); s._version = _version; return s; } @@ -183,7 +183,7 @@ public virtual void Push(object? obj) if (_size == _array.Length) { object[] newArray = new object[2 * _array.Length]; - Array.Copy(_array, 0, newArray, 0, _size); + Array.Copy(_array, newArray, _size); _array = newArray; } _array[_size++] = obj; diff --git a/src/System.Collections/src/System/Collections/BitArray.cs b/src/System.Collections/src/System/Collections/BitArray.cs index 40c2cfeee86c..e3d48d9c13ef 100644 --- a/src/System.Collections/src/System/Collections/BitArray.cs +++ b/src/System.Collections/src/System/Collections/BitArray.cs @@ -157,7 +157,7 @@ public BitArray(int[] values) } m_array = new int[values.Length]; - Array.Copy(values, 0, m_array, 0, values.Length); + Array.Copy(values, m_array, values.Length); m_length = values.Length * BitsPerInt32; _version = 0; @@ -181,7 +181,7 @@ public BitArray(BitArray bits) Debug.Assert(bits.m_array.Length <= arrayLength); - Array.Copy(bits.m_array, 0, m_array, 0, arrayLength); + Array.Copy(bits.m_array, m_array, arrayLength); m_length = bits.m_length; _version = bits._version; diff --git a/src/System.Collections/src/System/Collections/Generic/HashSet.cs b/src/System.Collections/src/System/Collections/Generic/HashSet.cs index 4a2f6fb4c4fc..099be370af52 100644 --- a/src/System.Collections/src/System/Collections/Generic/HashSet.cs +++ b/src/System.Collections/src/System/Collections/Generic/HashSet.cs @@ -1185,7 +1185,7 @@ private void SetCapacity(int newSize) Slot[] newSlots = new Slot[newSize]; if (_slots != null) { - Array.Copy(_slots, 0, newSlots, 0, _lastIndex); + Array.Copy(_slots, newSlots, _lastIndex); } int[] newBuckets = new int[newSize]; diff --git a/src/System.Collections/src/System/Collections/Generic/SortedList.cs b/src/System.Collections/src/System/Collections/Generic/SortedList.cs index 671072b805c5..96cf1fb84231 100644 --- a/src/System.Collections/src/System/Collections/Generic/SortedList.cs +++ b/src/System.Collections/src/System/Collections/Generic/SortedList.cs @@ -243,8 +243,8 @@ public int Capacity TValue[] newValues = new TValue[value]; if (_size > 0) { - Array.Copy(keys, 0, newKeys, 0, _size); - Array.Copy(values, 0, newValues, 0, _size); + Array.Copy(keys, newKeys, _size); + Array.Copy(values, newValues, _size); } keys = newKeys; values = newValues; diff --git a/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.AddAfter.cs b/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.AddAfter.cs index 7804bd98fdd7..223e2fd3ea8f 100644 --- a/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.AddAfter.cs +++ b/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.AddAfter.cs @@ -44,7 +44,7 @@ public void AddAfter_LLNode() linkedList.AddFirst(headItems[0]); tempItems = new T[headItems.Length]; - Array.Copy(headItems, 0, tempItems, 0, headItems.Length); + Array.Copy(headItems, tempItems, headItems.Length); Array.Reverse(tempItems, 1, headItems.Length - 1); for (int i = 1; i < arraySize; ++i) @@ -66,7 +66,7 @@ public void AddAfter_LLNode() linkedList.AddLast(headItems[1]); tempItems = new T[headItems.Length]; - Array.Copy(headItems, 0, tempItems, 0, headItems.Length); + Array.Copy(headItems, tempItems, headItems.Length); Array.Reverse(tempItems, 2, headItems.Length - 2); for (int i = 2; i < arraySize; ++i) @@ -128,7 +128,7 @@ public void AddAfter_LLNode() linkedList.AddAfter(linkedList.Last, tailItems[i]); T[] tempItems2 = new T[tempItems.Length + tailItems.Length]; - Array.Copy(tempItems, 0, tempItems2, 0, tempItems.Length); + Array.Copy(tempItems, tempItems2, tempItems.Length); Array.Copy(tailItems, 0, tempItems2, tempItems.Length, tailItems.Length); InitialItems_Tests(linkedList, tempItems2); @@ -173,7 +173,7 @@ public void AddAfter_LLNode() } tempItems = new T[headItemsReverse.Length + tailItems.Length]; - Array.Copy(headItemsReverse, 0, tempItems, 0, headItemsReverse.Length); + Array.Copy(headItemsReverse, tempItems, headItemsReverse.Length); Array.Copy(tailItems, 0, tempItems, headItemsReverse.Length, tailItems.Length); InitialItems_Tests(linkedList, tempItems); } @@ -247,7 +247,7 @@ public void AddAfter_LLNode_LLNode() linkedList.AddFirst(headItems[0]); tempItems = new T[headItems.Length]; - Array.Copy(headItems, 0, tempItems, 0, headItems.Length); + Array.Copy(headItems, tempItems, headItems.Length); Array.Reverse(tempItems, 1, headItems.Length - 1); for (int i = 1; i < arraySize; ++i) @@ -268,7 +268,7 @@ public void AddAfter_LLNode_LLNode() linkedList.AddFirst(headItems[0]); linkedList.AddLast(headItems[1]); tempItems = new T[headItems.Length]; - Array.Copy(headItems, 0, tempItems, 0, headItems.Length); + Array.Copy(headItems, tempItems, headItems.Length); Array.Reverse(tempItems, 2, headItems.Length - 2); for (int i = 2; i < arraySize; ++i) @@ -331,7 +331,7 @@ public void AddAfter_LLNode_LLNode() linkedList.AddAfter(linkedList.Last, new LinkedListNode(tailItems[i])); T[] tempItems2 = new T[tempItems.Length + tailItems.Length]; - Array.Copy(tempItems, 0, tempItems2, 0, tempItems.Length); + Array.Copy(tempItems, tempItems2, tempItems.Length); Array.Copy(tailItems, 0, tempItems2, tempItems.Length, tailItems.Length); InitialItems_Tests(linkedList, tempItems2); @@ -384,7 +384,7 @@ public void AddAfter_LLNode_LLNode() } tempItems = new T[headItemsReverse.Length + tailItems.Length]; - Array.Copy(headItemsReverse, 0, tempItems, 0, headItemsReverse.Length); + Array.Copy(headItemsReverse, tempItems, headItemsReverse.Length); Array.Copy(tailItems, 0, tempItems, headItemsReverse.Length, tailItems.Length); InitialItems_Tests(linkedList, tempItems); } diff --git a/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.AddBefore.cs b/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.AddBefore.cs index e8377199df91..33e9680ed119 100644 --- a/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.AddBefore.cs +++ b/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.AddBefore.cs @@ -66,7 +66,7 @@ public void AddBefore_LLNode() linkedList.AddLast(headItems[1]); tempItems = new T[headItems.Length]; - Array.Copy(headItems, 0, tempItems, 0, headItems.Length); + Array.Copy(headItems, tempItems, headItems.Length); Array.Reverse(tempItems, 1, headItems.Length - 1); for (int i = 2; i < arraySize; ++i) @@ -129,7 +129,7 @@ public void AddBefore_LLNode() linkedList.AddBefore(linkedList.First, tailItems[i]); T[] tempItems2 = new T[tailItemsReverse.Length + tempItems.Length]; - Array.Copy(tailItemsReverse, 0, tempItems2, 0, tailItemsReverse.Length); + Array.Copy(tailItemsReverse, tempItems2, tailItemsReverse.Length); Array.Copy(tempItems, 0, tempItems2, tailItemsReverse.Length, tempItems.Length); InitialItems_Tests(linkedList, tempItems2); @@ -174,7 +174,7 @@ public void AddBefore_LLNode() } tempItems = new T[headItemsReverse.Length + tailItems.Length]; - Array.Copy(headItemsReverse, 0, tempItems, 0, headItemsReverse.Length); + Array.Copy(headItemsReverse, tempItems, headItemsReverse.Length); Array.Copy(tailItems, 0, tempItems, headItemsReverse.Length, tailItems.Length); InitialItems_Tests(linkedList, tempItems); @@ -266,7 +266,7 @@ public void AddBefore_LLNode_LLNode() linkedList.AddFirst(headItems[0]); linkedList.AddLast(headItems[1]); tempItems = new T[headItems.Length]; - Array.Copy(headItems, 0, tempItems, 0, headItems.Length); + Array.Copy(headItems, tempItems, headItems.Length); Array.Reverse(tempItems, 1, headItems.Length - 1); for (int i = 2; i < arraySize; ++i) @@ -328,7 +328,7 @@ public void AddBefore_LLNode_LLNode() linkedList.AddBefore(linkedList.First, new LinkedListNode(tailItems[i])); T[] tempItems2 = new T[tailItemsReverse.Length + tempItems.Length]; - Array.Copy(tailItemsReverse, 0, tempItems2, 0, tailItemsReverse.Length); + Array.Copy(tailItemsReverse, tempItems2, tailItemsReverse.Length); Array.Copy(tempItems, 0, tempItems2, tailItemsReverse.Length, tempItems.Length); InitialItems_Tests(linkedList, tempItems2); @@ -373,7 +373,7 @@ public void AddBefore_LLNode_LLNode() } tempItems = new T[headItemsReverse.Length + tailItems.Length]; - Array.Copy(headItemsReverse, 0, tempItems, 0, headItemsReverse.Length); + Array.Copy(headItemsReverse, tempItems, headItemsReverse.Length); Array.Copy(tailItems, 0, tempItems, headItemsReverse.Length, tailItems.Length); InitialItems_Tests(linkedList, tempItems); diff --git a/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.AddFirst.cs b/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.AddFirst.cs index 85c130453c8b..3b1b9f96f697 100644 --- a/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.AddFirst.cs +++ b/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.AddFirst.cs @@ -68,7 +68,7 @@ public void AddFirst_T_Tests() linkedList.AddFirst(tailItems[i]); tempItems2 = new T[tempItems.Length + tailItemsReverse.Length]; - Array.Copy(tailItemsReverse, 0, tempItems2, 0, tailItemsReverse.Length); + Array.Copy(tailItemsReverse, tempItems2, tailItemsReverse.Length); Array.Copy(tempItems, 0, tempItems2, tailItemsReverse.Length, tempItems.Length); InitialItems_Tests(linkedList, tempItems2); @@ -106,7 +106,7 @@ public void AddFirst_T_Tests() } tempItems = new T[headItemsReverse.Length + tailItems.Length]; - Array.Copy(headItemsReverse, 0, tempItems, 0, headItemsReverse.Length); + Array.Copy(headItemsReverse, tempItems, headItemsReverse.Length); Array.Copy(tailItems, 0, tempItems, headItemsReverse.Length, tailItems.Length); InitialItems_Tests(linkedList, tempItems); @@ -167,7 +167,7 @@ public void AddFirst_LinkedListNode() linkedList.AddFirst(new LinkedListNode(tailItems[i])); tempItems2 = new T[tailItemsReverse.Length + tempItems.Length]; - Array.Copy(tailItemsReverse, 0, tempItems2, 0, tailItemsReverse.Length); + Array.Copy(tailItemsReverse, tempItems2, tailItemsReverse.Length); Array.Copy(tempItems, 0, tempItems2, tailItemsReverse.Length, tempItems.Length); InitialItems_Tests(linkedList, tempItems2); @@ -194,7 +194,7 @@ public void AddFirst_LinkedListNode() } tempItems = new T[headItemsReverse.Length + tailItems.Length]; - Array.Copy(headItemsReverse, 0, tempItems, 0, headItemsReverse.Length); + Array.Copy(headItemsReverse, tempItems, headItemsReverse.Length); Array.Copy(tailItems, 0, tempItems, headItemsReverse.Length, tailItems.Length); InitialItems_Tests(linkedList, tempItems); } diff --git a/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.AddLast.cs b/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.AddLast.cs index af6cbe4adf0f..e9072a9ee385 100644 --- a/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.AddLast.cs +++ b/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.AddLast.cs @@ -61,7 +61,7 @@ public void AddLast_T_Tests() linkedList.AddLast(headItems[i]); T[] tempItems2 = new T[tempItems.Length + headItems.Length]; - Array.Copy(tempItems, 0, tempItems2, 0, tempItems.Length); + Array.Copy(tempItems, tempItems2, tempItems.Length); Array.Copy(headItems, 0, tempItems2, tempItems.Length, headItems.Length); InitialItems_Tests(linkedList, tempItems2); @@ -94,7 +94,7 @@ public void AddLast_T_Tests() } tempItems2 = new T[tempItems.Length + tailItems.Length]; - Array.Copy(tempItems, 0, tempItems2, 0, tempItems.Length); + Array.Copy(tempItems, tempItems2, tempItems.Length); Array.Copy(tailItems, 0, tempItems2, tempItems.Length, tailItems.Length); InitialItems_Tests(linkedList, tempItems2); } @@ -153,7 +153,7 @@ public void AddLast_LinkedListNode() linkedList.AddLast(new LinkedListNode(headItems[i])); T[] tempItems2 = new T[tempItems.Length + headItems.Length]; - Array.Copy(tempItems, 0, tempItems2, 0, tempItems.Length); + Array.Copy(tempItems, tempItems2, tempItems.Length); Array.Copy(headItems, 0, tempItems2, tempItems.Length, headItems.Length); InitialItems_Tests(linkedList, tempItems2); @@ -179,7 +179,7 @@ public void AddLast_LinkedListNode() } tempItems = new T[headItemsReverse.Length + tailItems.Length]; - Array.Copy(headItemsReverse, 0, tempItems, 0, headItemsReverse.Length); + Array.Copy(headItemsReverse, tempItems, headItemsReverse.Length); Array.Copy(tailItems, 0, tempItems, headItemsReverse.Length, tailItems.Length); InitialItems_Tests(linkedList, tempItems); } diff --git a/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.Find.cs b/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.Find.cs index b93e7c62f1d2..02a905cc2fd1 100644 --- a/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.Find.cs +++ b/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.Find.cs @@ -76,7 +76,7 @@ public void Find_T() Assert.Null(linkedList.Find(tailItems[0])); //"Err_8548ajia Expected Find to return false with an non null item not in the collection size=16" Assert.Null(linkedList.Find(default(T))); //"Err_3108qoa Expected Find to return false with an null item not in the collection size=16" T[] tempItems = new T[headItems.Length + headItems.Length]; - Array.Copy(headItems, 0, tempItems, 0, headItems.Length); + Array.Copy(headItems, tempItems, headItems.Length); Array.Copy(headItems, 0, tempItems, headItems.Length, headItems.Length); VerifyFindDuplicates(linkedList, tempItems); @@ -111,7 +111,7 @@ public void Find_T() Array.Copy(tailItems, 0, tempItems, 1, tailItems.Length); T[] tempItems2 = new T[headItems.Length + tempItems.Length]; - Array.Copy(headItems, 0, tempItems2, 0, headItems.Length); + Array.Copy(headItems, tempItems2, headItems.Length); Array.Copy(tempItems, 0, tempItems2, headItems.Length, tempItems.Length); VerifyFind(linkedList, tempItems2); @@ -125,7 +125,7 @@ public void Find_T() Assert.Null(linkedList.Find(tailItems[0])); //"Err_208089ajdi Expected Find to return false with an non null item not in the collection default(T) at the end" tempItems = new T[headItems.Length + 1]; tempItems[headItems.Length] = default(T); - Array.Copy(headItems, 0, tempItems, 0, headItems.Length); + Array.Copy(headItems, tempItems, headItems.Length); VerifyFind(linkedList, tempItems); } } diff --git a/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.FindLast.cs b/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.FindLast.cs index 5769211e2338..294710fd2382 100644 --- a/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.FindLast.cs +++ b/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.FindLast.cs @@ -85,7 +85,7 @@ public void FindLast_T() Assert.Null(linkedList.FindLast(tailItems[0])); //"Err_8548ajia Expected FindLast to return false with an non null item not in the collection size=16" Assert.Null(linkedList.FindLast(default(T))); //"Err_3108qoa Expected FindLast to return false with an null item not in the collection size=16" T[] tempItems = new T[headItems.Length + headItems.Length]; - Array.Copy(headItems, 0, tempItems, 0, headItems.Length); + Array.Copy(headItems, tempItems, headItems.Length); Array.Copy(headItems, 0, tempItems, headItems.Length, headItems.Length); VerifyFindLastDuplicates(linkedList, tempItems); @@ -109,7 +109,7 @@ public void FindLast_T() Assert.Null(linkedList.FindLast(CreateT(seed++))); //"Err_78585ajhed Expected FindLast to return false with an non null item not in the collection default(T) in the middle" tempItems = new T[headItems.Length + prependDefaultTailItems.Length]; - Array.Copy(headItems, 0, tempItems, 0, headItems.Length); + Array.Copy(headItems, tempItems, headItems.Length); Array.Copy(prependDefaultTailItems, 0, tempItems, headItems.Length, prependDefaultTailItems.Length); VerifyFindLast(linkedList, tempItems); diff --git a/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.RemoveLast.cs b/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.RemoveLast.cs index 95faec41066e..ddfc65e98a70 100644 --- a/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.RemoveLast.cs +++ b/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.RemoveLast.cs @@ -85,7 +85,7 @@ public void RemoveLast_Tests() linkedList.RemoveLast(); int length = arraySize - i - 1; T[] expectedItems = new T[length]; - Array.Copy(headItems, 0, expectedItems, 0, length); + Array.Copy(headItems, expectedItems, length); InitialItems_Tests(linkedList, expectedItems); } @@ -116,4 +116,4 @@ public void RemoveLast_Tests_Negative() InitialItems_Tests(linkedList, new T[0]); } } -} \ No newline at end of file +} diff --git a/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.RemoveNode.cs b/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.RemoveNode.cs index 3e2bddf892f4..1f59e587db76 100644 --- a/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.RemoveNode.cs +++ b/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.RemoveNode.cs @@ -150,7 +150,7 @@ public void Remove_LLNode() { linkedList.Remove(linkedList.Last); //Remove when VS Whidbey: 234648 is resolved T[] expectedItems = new T[i]; - Array.Copy(headItems, 0, expectedItems, 0, i); + Array.Copy(headItems, expectedItems, i); InitialItems_Tests(linkedList, expectedItems); } diff --git a/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.cs b/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.cs index fa4cfa8c5e2f..e8a961f61229 100644 --- a/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.cs +++ b/src/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.cs @@ -477,7 +477,7 @@ private void VerifyRemovedNode(LinkedList linkedList, T[] linkedListValues, L Assert.Equal(expectedValue, node.Value); //"Err_823902jaied Node.Value" T[] expected = new T[linkedListValues.Length + 1]; - Array.Copy(linkedListValues, 0, expected, 0, linkedListValues.Length); + Array.Copy(linkedListValues, expected, linkedListValues.Length); expected[linkedListValues.Length] = expectedValue; InitialItems_Tests(linkedList, expected); diff --git a/src/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/UIHintAttribute.cs b/src/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/UIHintAttribute.cs index fecc0faae6b0..0772eae0e1a4 100644 --- a/src/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/UIHintAttribute.cs +++ b/src/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/UIHintAttribute.cs @@ -81,7 +81,7 @@ public UIHintImplementation(string uiHint, string presentationLayer, params obje if (controlParameters != null) { _inputControlParameters = new object[controlParameters.Length]; - Array.Copy(controlParameters, 0, _inputControlParameters, 0, controlParameters.Length); + Array.Copy(controlParameters, _inputControlParameters, controlParameters.Length); } } diff --git a/src/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/AtomicComposition.cs b/src/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/AtomicComposition.cs index 3d2dc8ce9652..86cf668abef4 100644 --- a/src/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/AtomicComposition.cs +++ b/src/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/AtomicComposition.cs @@ -319,7 +319,7 @@ private void SetValueInternal(object key, object value) var newQueries = new KeyValuePair[_valueCount == 0 ? 5 : _valueCount * 2]; if (_values != null) { - Array.Copy(_values, 0, newQueries, 0, _valueCount); + Array.Copy(_values, newQueries, _valueCount); } _values = newQueries; } diff --git a/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/AttributeCollection.cs b/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/AttributeCollection.cs index 135ec199676a..5ee2e185d516 100644 --- a/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/AttributeCollection.cs +++ b/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/AttributeCollection.cs @@ -108,7 +108,7 @@ public static AttributeCollection FromExisting(AttributeCollection existing, par if (actualCount < newArray.Length) { attributes = new Attribute[actualCount]; - Array.Copy(newArray, 0, attributes, 0, actualCount); + Array.Copy(newArray, attributes, actualCount); } else { diff --git a/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/Container.cs b/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/Container.cs index 23b085ae61d8..ca6ed937a306 100644 --- a/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/Container.cs +++ b/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/Container.cs @@ -57,7 +57,7 @@ public virtual void Add(IComponent component, string name) if (_sites.Length == _siteCount) { ISite[] newSites = new ISite[_siteCount * 2]; - Array.Copy(_sites, 0, newSites, 0, _siteCount); + Array.Copy(_sites, newSites, _siteCount); _sites = newSites; } } diff --git a/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/CultureInfoConverter.cs b/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/CultureInfoConverter.cs index 04e66993c592..0e918ef8d672 100644 --- a/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/CultureInfoConverter.cs +++ b/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/CultureInfoConverter.cs @@ -192,7 +192,7 @@ public override StandardValuesCollection GetStandardValues(ITypeDescriptorContex array = new CultureInfo[installedCultures.Length + 1]; } - Array.Copy(installedCultures, 0, array, 0, installedCultures.Length); + Array.Copy(installedCultures, array, installedCultures.Length); Array.Sort(array, new CultureComparer(this)); Debug.Assert(array[0] == null); if (array[0] == null) diff --git a/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/EventDescriptorCollection.cs b/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/EventDescriptorCollection.cs index 9120f17d0cf0..ee6b5fea0ad1 100644 --- a/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/EventDescriptorCollection.cs +++ b/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/EventDescriptorCollection.cs @@ -131,7 +131,7 @@ private void EnsureEventsOwned() if (_events != null) { EventDescriptor[] newEvents = new EventDescriptor[Count]; - Array.Copy(_events, 0, newEvents, 0, Count); + Array.Copy(_events, newEvents, Count); _events = newEvents; } } @@ -161,7 +161,7 @@ private void EnsureSize(int sizeNeeded) int newSize = Math.Max(sizeNeeded, _events.Length * 2); EventDescriptor[] newEvents = new EventDescriptor[newSize]; - Array.Copy(_events, 0, newEvents, 0, Count); + Array.Copy(_events, newEvents, Count); _events = newEvents; } diff --git a/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/PropertyDescriptor.cs b/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/PropertyDescriptor.cs index 68d24a25aaf1..ca110bf65b11 100644 --- a/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/PropertyDescriptor.cs +++ b/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/PropertyDescriptor.cs @@ -299,8 +299,8 @@ public virtual object GetEditor(Type editorBaseType) { Type[] newTypes = new Type[_editorTypes.Length * 2]; object[] newEditors = new object[_editors.Length * 2]; - Array.Copy(_editorTypes, 0, newTypes, 0, _editorTypes.Length); - Array.Copy(_editors, 0, newEditors, 0, _editors.Length); + Array.Copy(_editorTypes, newTypes, _editorTypes.Length); + Array.Copy(_editors, newEditors, _editors.Length); _editorTypes = newTypes; _editors = newEditors; } diff --git a/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/PropertyDescriptorCollection.cs b/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/PropertyDescriptorCollection.cs index bba5224378a5..1479542b17d6 100644 --- a/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/PropertyDescriptorCollection.cs +++ b/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/PropertyDescriptorCollection.cs @@ -142,7 +142,7 @@ private void EnsurePropsOwned() if (_properties != null) { PropertyDescriptor[] newProps = new PropertyDescriptor[Count]; - Array.Copy(_properties, 0, newProps, 0, Count); + Array.Copy(_properties, newProps, Count); _properties = newProps; } } @@ -172,7 +172,7 @@ private void EnsureSize(int sizeNeeded) int newSize = Math.Max(sizeNeeded, _properties.Length * 2); PropertyDescriptor[] newProps = new PropertyDescriptor[newSize]; - Array.Copy(_properties, 0, newProps, 0, Count); + Array.Copy(_properties, newProps, Count); _properties = newProps; } @@ -400,7 +400,7 @@ public virtual IEnumerator GetEnumerator() if (_properties.Length != Count) { PropertyDescriptor[] enumProps = new PropertyDescriptor[Count]; - Array.Copy(_properties, 0, enumProps, 0, Count); + Array.Copy(_properties, enumProps, Count); return enumProps.GetEnumerator(); } return _properties.GetEnumerator(); @@ -531,7 +531,7 @@ ICollection IDictionary.Values if (_properties.Length != Count) { PropertyDescriptor[] newProps = new PropertyDescriptor[Count]; - Array.Copy(_properties, 0, newProps, 0, Count); + Array.Copy(_properties, newProps, Count); return newProps; } else diff --git a/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/ReflectTypeDescriptionProvider.ReflectedTypeData.cs b/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/ReflectTypeDescriptionProvider.ReflectedTypeData.cs index c0cbc7d52447..fe743fbb674e 100644 --- a/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/ReflectTypeDescriptionProvider.ReflectedTypeData.cs +++ b/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/ReflectTypeDescriptionProvider.ReflectedTypeData.cs @@ -87,7 +87,7 @@ internal AttributeCollection GetAttributes() { Attribute[] baseArray = ReflectGetAttributes(baseType); Attribute[] temp = new Attribute[attrArray.Length + baseArray.Length]; - Array.Copy(attrArray, 0, temp, 0, attrArray.Length); + Array.Copy(attrArray, temp, attrArray.Length); Array.Copy(baseArray, 0, temp, attrArray.Length, baseArray.Length); attrArray = temp; baseType = baseType.BaseType; @@ -110,7 +110,7 @@ internal AttributeCollection GetAttributes() if (ifaceAttrs.Count > 0) { Attribute[] temp = new Attribute[attrArray.Length + ifaceAttrs.Count]; - Array.Copy(attrArray, 0, temp, 0, attrArray.Length); + Array.Copy(attrArray, temp, attrArray.Length); ifaceAttrs.CopyTo(temp, attrArray.Length); attrArray = temp; } diff --git a/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/ReflectTypeDescriptionProvider.cs b/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/ReflectTypeDescriptionProvider.cs index 50835f0221d6..a862665b004f 100644 --- a/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/ReflectTypeDescriptionProvider.cs +++ b/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/ReflectTypeDescriptionProvider.cs @@ -1007,7 +1007,7 @@ private static EventDescriptor[] ReflectGetEvents(Type type) if (eventCount != events.Length) { EventDescriptor[] newEvents = new EventDescriptor[eventCount]; - Array.Copy(events, 0, newEvents, 0, eventCount); + Array.Copy(events, newEvents, eventCount); events = newEvents; } @@ -1196,7 +1196,7 @@ private static PropertyDescriptor[] ReflectGetProperties(Type type) if (propertyCount != properties.Length) { PropertyDescriptor[] newProperties = new PropertyDescriptor[propertyCount]; - Array.Copy(properties, 0, newProperties, 0, propertyCount); + Array.Copy(properties, newProperties, propertyCount); properties = newProperties; } diff --git a/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs b/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs index 67f8f918a329..b63ab0d5ef33 100644 --- a/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs +++ b/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs @@ -2770,7 +2770,7 @@ public override AttributeCollection GetAttributes() if (actualCount < newArray.Length) { finalAttr = new Attribute[actualCount]; - Array.Copy(newArray, 0, finalAttr, 0, actualCount); + Array.Copy(newArray, finalAttr, actualCount); } else { diff --git a/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeListConverter.cs b/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeListConverter.cs index 6c1e5dfcaf83..3d955b881a69 100644 --- a/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeListConverter.cs +++ b/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeListConverter.cs @@ -99,7 +99,7 @@ public override StandardValuesCollection GetStandardValues(ITypeDescriptorContex if (_types != null) { objTypes = new object[_types.Length]; - Array.Copy(_types, 0, objTypes, 0, _types.Length); + Array.Copy(_types, objTypes, _types.Length); } else { diff --git a/src/System.Data.Common/src/System/Data/ColumnTypeConverter.cs b/src/System.Data.Common/src/System/Data/ColumnTypeConverter.cs index a911b87f375c..cdfa6fa56869 100644 --- a/src/System.Data.Common/src/System/Data/ColumnTypeConverter.cs +++ b/src/System.Data.Common/src/System/Data/ColumnTypeConverter.cs @@ -139,7 +139,7 @@ public override StandardValuesCollection GetStandardValues(ITypeDescriptorContex if (s_types != null) { objTypes = new object[s_types.Length]; - Array.Copy(s_types, 0, objTypes, 0, s_types.Length); + Array.Copy(s_types, objTypes, s_types.Length); } else { diff --git a/src/System.Data.Common/src/System/Data/Common/BigIntegerStorage.cs b/src/System.Data.Common/src/System/Data/Common/BigIntegerStorage.cs index 3dc62a45aad6..ecbe95cf260f 100644 --- a/src/System.Data.Common/src/System/Data/Common/BigIntegerStorage.cs +++ b/src/System.Data.Common/src/System/Data/Common/BigIntegerStorage.cs @@ -144,7 +144,7 @@ public override void SetCapacity(int capacity) BigInteger[] newValues = new BigInteger[capacity]; if (null != _values) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; base.SetCapacity(capacity); diff --git a/src/System.Data.Common/src/System/Data/Common/BooleanStorage.cs b/src/System.Data.Common/src/System/Data/Common/BooleanStorage.cs index 0b6424609ade..43654c493588 100644 --- a/src/System.Data.Common/src/System/Data/Common/BooleanStorage.cs +++ b/src/System.Data.Common/src/System/Data/Common/BooleanStorage.cs @@ -164,7 +164,7 @@ public override void SetCapacity(int capacity) bool[] newValues = new bool[capacity]; if (null != _values) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; base.SetCapacity(capacity); diff --git a/src/System.Data.Common/src/System/Data/Common/ByteStorage.cs b/src/System.Data.Common/src/System/Data/Common/ByteStorage.cs index 0e06e267b227..30f25eed6850 100644 --- a/src/System.Data.Common/src/System/Data/Common/ByteStorage.cs +++ b/src/System.Data.Common/src/System/Data/Common/ByteStorage.cs @@ -236,7 +236,7 @@ public override void SetCapacity(int capacity) byte[] newValues = new byte[capacity]; if (null != _values) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; base.SetCapacity(capacity); diff --git a/src/System.Data.Common/src/System/Data/Common/CharStorage.cs b/src/System.Data.Common/src/System/Data/Common/CharStorage.cs index 7d7d29b3f14c..8a60eba9367a 100644 --- a/src/System.Data.Common/src/System/Data/Common/CharStorage.cs +++ b/src/System.Data.Common/src/System/Data/Common/CharStorage.cs @@ -168,7 +168,7 @@ public override void SetCapacity(int capacity) char[] newValues = new char[capacity]; if (null != _values) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; base.SetCapacity(capacity); diff --git a/src/System.Data.Common/src/System/Data/Common/DateTimeOffsetStorage.cs b/src/System.Data.Common/src/System/Data/Common/DateTimeOffsetStorage.cs index aeda9387c7c1..92fd81410a62 100644 --- a/src/System.Data.Common/src/System/Data/Common/DateTimeOffsetStorage.cs +++ b/src/System.Data.Common/src/System/Data/Common/DateTimeOffsetStorage.cs @@ -171,7 +171,7 @@ public override void SetCapacity(int capacity) DateTimeOffset[] newValues = new DateTimeOffset[capacity]; if (null != _values) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; base.SetCapacity(capacity); diff --git a/src/System.Data.Common/src/System/Data/Common/DateTimeStorage.cs b/src/System.Data.Common/src/System/Data/Common/DateTimeStorage.cs index 72761dad4dd1..cf2f5e683b1e 100644 --- a/src/System.Data.Common/src/System/Data/Common/DateTimeStorage.cs +++ b/src/System.Data.Common/src/System/Data/Common/DateTimeStorage.cs @@ -210,7 +210,7 @@ public override void SetCapacity(int capacity) DateTime[] newValues = new DateTime[capacity]; if (null != _values) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; base.SetCapacity(capacity); diff --git a/src/System.Data.Common/src/System/Data/Common/DbConnectionStringBuilder.cs b/src/System.Data.Common/src/System/Data/Common/DbConnectionStringBuilder.cs index e2a5455a3707..3658c6d1a888 100644 --- a/src/System.Data.Common/src/System/Data/Common/DbConnectionStringBuilder.cs +++ b/src/System.Data.Common/src/System/Data/Common/DbConnectionStringBuilder.cs @@ -548,7 +548,7 @@ private PropertyDescriptorCollection GetProperties(Attribute[] attributes) // Create a new array that only contains the filtered properties PropertyDescriptor[] filteredPropertiesArray = new PropertyDescriptor[index]; - Array.Copy(propertiesArray, 0, filteredPropertiesArray, 0, index); + Array.Copy(propertiesArray, filteredPropertiesArray, index); return new PropertyDescriptorCollection(filteredPropertiesArray); } diff --git a/src/System.Data.Common/src/System/Data/Common/DbDataAdapter.cs b/src/System.Data.Common/src/System/Data/Common/DbDataAdapter.cs index 00adf022217d..4f706f7a08bc 100644 --- a/src/System.Data.Common/src/System/Data/Common/DbDataAdapter.cs +++ b/src/System.Data.Common/src/System/Data/Common/DbDataAdapter.cs @@ -1286,7 +1286,7 @@ protected virtual int Update(DataRow[] dataRows, DataTableMapping tableMapping) if (commandCount < rowBatch.Length) { finalRowBatch = new DataRow[commandCount]; - Array.Copy(rowBatch, 0, finalRowBatch, 0, commandCount); + Array.Copy(rowBatch, finalRowBatch, commandCount); } rowUpdatedEvent.AdapterInit(finalRowBatch); diff --git a/src/System.Data.Common/src/System/Data/Common/DecimalStorage.cs b/src/System.Data.Common/src/System/Data/Common/DecimalStorage.cs index 847dfb2ea600..fdd41695b6ff 100644 --- a/src/System.Data.Common/src/System/Data/Common/DecimalStorage.cs +++ b/src/System.Data.Common/src/System/Data/Common/DecimalStorage.cs @@ -232,7 +232,7 @@ public override void SetCapacity(int capacity) decimal[] newValues = new decimal[capacity]; if (null != _values) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; base.SetCapacity(capacity); diff --git a/src/System.Data.Common/src/System/Data/Common/DoubleStorage.cs b/src/System.Data.Common/src/System/Data/Common/DoubleStorage.cs index c582b7509000..2bea0c2477f1 100644 --- a/src/System.Data.Common/src/System/Data/Common/DoubleStorage.cs +++ b/src/System.Data.Common/src/System/Data/Common/DoubleStorage.cs @@ -236,7 +236,7 @@ public override void SetCapacity(int capacity) double[] newValues = new double[capacity]; if (null != _values) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; base.SetCapacity(capacity); diff --git a/src/System.Data.Common/src/System/Data/Common/Int16Storage.cs b/src/System.Data.Common/src/System/Data/Common/Int16Storage.cs index e2e93596e833..e0c22d7d2270 100644 --- a/src/System.Data.Common/src/System/Data/Common/Int16Storage.cs +++ b/src/System.Data.Common/src/System/Data/Common/Int16Storage.cs @@ -250,7 +250,7 @@ public override void SetCapacity(int capacity) short[] newValues = new short[capacity]; if (null != _values) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; base.SetCapacity(capacity); diff --git a/src/System.Data.Common/src/System/Data/Common/Int32Storage.cs b/src/System.Data.Common/src/System/Data/Common/Int32Storage.cs index ec5559e410a3..dc949c6bf3e7 100644 --- a/src/System.Data.Common/src/System/Data/Common/Int32Storage.cs +++ b/src/System.Data.Common/src/System/Data/Common/Int32Storage.cs @@ -250,7 +250,7 @@ public override void SetCapacity(int capacity) int[] newValues = new int[capacity]; if (null != _values) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; base.SetCapacity(capacity); diff --git a/src/System.Data.Common/src/System/Data/Common/Int64Storage.cs b/src/System.Data.Common/src/System/Data/Common/Int64Storage.cs index 8131369ac113..bc103a31d15a 100644 --- a/src/System.Data.Common/src/System/Data/Common/Int64Storage.cs +++ b/src/System.Data.Common/src/System/Data/Common/Int64Storage.cs @@ -242,7 +242,7 @@ public override void SetCapacity(int capacity) long[] newValues = new long[capacity]; if (null != _values) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; base.SetCapacity(capacity); diff --git a/src/System.Data.Common/src/System/Data/Common/ObjectStorage.cs b/src/System.Data.Common/src/System/Data/Common/ObjectStorage.cs index 2b7a8363aa31..ffe4960cce7b 100644 --- a/src/System.Data.Common/src/System/Data/Common/ObjectStorage.cs +++ b/src/System.Data.Common/src/System/Data/Common/ObjectStorage.cs @@ -302,7 +302,7 @@ public override void SetCapacity(int capacity) object[] newValues = new object[capacity]; if (_values != null) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; } diff --git a/src/System.Data.Common/src/System/Data/Common/SByteStorage.cs b/src/System.Data.Common/src/System/Data/Common/SByteStorage.cs index 3112c5bf4a4b..6d5ce4cfbd74 100644 --- a/src/System.Data.Common/src/System/Data/Common/SByteStorage.cs +++ b/src/System.Data.Common/src/System/Data/Common/SByteStorage.cs @@ -238,7 +238,7 @@ public override void SetCapacity(int capacity) sbyte[] newValues = new sbyte[capacity]; if (null != _values) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; base.SetCapacity(capacity); diff --git a/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLBinaryStorage.cs b/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLBinaryStorage.cs index 4b1585c72e08..c893cfc0c24a 100644 --- a/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLBinaryStorage.cs +++ b/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLBinaryStorage.cs @@ -93,7 +93,7 @@ public override void SetCapacity(int capacity) SqlBinary[] newValues = new SqlBinary[capacity]; if (null != _values) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; } diff --git a/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLByteStorage.cs b/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLByteStorage.cs index a35248fa58c0..17f7eea68b14 100644 --- a/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLByteStorage.cs +++ b/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLByteStorage.cs @@ -203,7 +203,7 @@ public override void SetCapacity(int capacity) SqlByte[] newValues = new SqlByte[capacity]; if (null != _values) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; } diff --git a/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLBytesStorage.cs b/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLBytesStorage.cs index 609ea5414bfa..8a64b958d3ee 100644 --- a/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLBytesStorage.cs +++ b/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLBytesStorage.cs @@ -92,7 +92,7 @@ public override void SetCapacity(int capacity) SqlBytes[] newValues = new SqlBytes[capacity]; if (null != _values) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; } diff --git a/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLCharsStorage.cs b/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLCharsStorage.cs index ffc131c36a5d..893c94834429 100644 --- a/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLCharsStorage.cs +++ b/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLCharsStorage.cs @@ -94,7 +94,7 @@ public override void SetCapacity(int capacity) SqlChars[] newValues = new SqlChars[capacity]; if (null != _values) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; } diff --git a/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLDateTimeStorage.cs b/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLDateTimeStorage.cs index 9ff763d62355..692114a33257 100644 --- a/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLDateTimeStorage.cs +++ b/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLDateTimeStorage.cs @@ -129,7 +129,7 @@ public override void SetCapacity(int capacity) SqlDateTime[] newValues = new SqlDateTime[capacity]; if (null != _values) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; } diff --git a/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLDecimalStorage.cs b/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLDecimalStorage.cs index 109d7d02a911..3d624d91c415 100644 --- a/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLDecimalStorage.cs +++ b/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLDecimalStorage.cs @@ -201,7 +201,7 @@ public override void SetCapacity(int capacity) SqlDecimal[] newValues = new SqlDecimal[capacity]; if (null != _values) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; } diff --git a/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLDoubleStorage.cs b/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLDoubleStorage.cs index 273ebc680a0b..36311be7f4fc 100644 --- a/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLDoubleStorage.cs +++ b/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLDoubleStorage.cs @@ -202,7 +202,7 @@ public override void SetCapacity(int capacity) SqlDouble[] newValues = new SqlDouble[capacity]; if (null != _values) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; } diff --git a/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLGuidStorage.cs b/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLGuidStorage.cs index 442325f99a93..be24e799bf2a 100644 --- a/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLGuidStorage.cs +++ b/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLGuidStorage.cs @@ -94,7 +94,7 @@ public override void SetCapacity(int capacity) SqlGuid[] newValues = new SqlGuid[capacity]; if (null != _values) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; } diff --git a/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLInt16Storage.cs b/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLInt16Storage.cs index a643e7e474c3..3d7cabbc8f3b 100644 --- a/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLInt16Storage.cs +++ b/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLInt16Storage.cs @@ -202,7 +202,7 @@ public override void SetCapacity(int capacity) SqlInt16[] newValues = new SqlInt16[capacity]; if (null != _values) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; } diff --git a/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLInt32Storage.cs b/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLInt32Storage.cs index 0b451d819f17..57660c34b9ff 100644 --- a/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLInt32Storage.cs +++ b/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLInt32Storage.cs @@ -202,7 +202,7 @@ public override void SetCapacity(int capacity) SqlInt32[] newValues = new SqlInt32[capacity]; if (null != _values) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; } diff --git a/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLInt64Storage.cs b/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLInt64Storage.cs index 42693ea9e1a2..d31a7eec29be 100644 --- a/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLInt64Storage.cs +++ b/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLInt64Storage.cs @@ -203,7 +203,7 @@ public override void SetCapacity(int capacity) SqlInt64[] newValues = new SqlInt64[capacity]; if (null != _values) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; } diff --git a/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLMoneyStorage.cs b/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLMoneyStorage.cs index 13319a1f2538..51fa06e8b802 100644 --- a/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLMoneyStorage.cs +++ b/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLMoneyStorage.cs @@ -202,7 +202,7 @@ public override void SetCapacity(int capacity) SqlMoney[] newValues = new SqlMoney[capacity]; if (null != _values) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; } diff --git a/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLSingleStorage.cs b/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLSingleStorage.cs index 3e9ce8bf5bca..72e4fb00112f 100644 --- a/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLSingleStorage.cs +++ b/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLSingleStorage.cs @@ -200,7 +200,7 @@ public override void SetCapacity(int capacity) SqlSingle[] newValues = new SqlSingle[capacity]; if (null != _values) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; } diff --git a/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLStringStorage.cs b/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLStringStorage.cs index b6aa93bf5262..8b7673f8457a 100644 --- a/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLStringStorage.cs +++ b/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQLStringStorage.cs @@ -155,7 +155,7 @@ public override void SetCapacity(int capacity) SqlString[] newValues = new SqlString[capacity]; if (null != _values) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; } diff --git a/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQlBooleanStorage.cs b/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQlBooleanStorage.cs index 974c5fb37ce9..f3cd98a16968 100644 --- a/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQlBooleanStorage.cs +++ b/src/System.Data.Common/src/System/Data/Common/SQLTypes/SQlBooleanStorage.cs @@ -127,7 +127,7 @@ public override void SetCapacity(int capacity) SqlBoolean[] newValues = new SqlBoolean[capacity]; if (null != _values) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; } diff --git a/src/System.Data.Common/src/System/Data/Common/SingleStorage.cs b/src/System.Data.Common/src/System/Data/Common/SingleStorage.cs index 957b0a02ff5c..6ca14a59237d 100644 --- a/src/System.Data.Common/src/System/Data/Common/SingleStorage.cs +++ b/src/System.Data.Common/src/System/Data/Common/SingleStorage.cs @@ -237,7 +237,7 @@ public override void SetCapacity(int capacity) float[] newValues = new float[capacity]; if (null != _values) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; base.SetCapacity(capacity); diff --git a/src/System.Data.Common/src/System/Data/Common/SqlUDTStorage.cs b/src/System.Data.Common/src/System/Data/Common/SqlUDTStorage.cs index 20f61490a762..8d0306d266dc 100644 --- a/src/System.Data.Common/src/System/Data/Common/SqlUDTStorage.cs +++ b/src/System.Data.Common/src/System/Data/Common/SqlUDTStorage.cs @@ -135,7 +135,7 @@ public override void SetCapacity(int capacity) object[] newValues = new object[capacity]; if (_values != null) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; base.SetCapacity(capacity); diff --git a/src/System.Data.Common/src/System/Data/Common/StringStorage.cs b/src/System.Data.Common/src/System/Data/Common/StringStorage.cs index 95bfabe32ef5..b6ccae093897 100644 --- a/src/System.Data.Common/src/System/Data/Common/StringStorage.cs +++ b/src/System.Data.Common/src/System/Data/Common/StringStorage.cs @@ -182,7 +182,7 @@ public override void SetCapacity(int capacity) string[] newValues = new string[capacity]; if (_values != null) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; } diff --git a/src/System.Data.Common/src/System/Data/Common/TimeSpanStorage.cs b/src/System.Data.Common/src/System/Data/Common/TimeSpanStorage.cs index 9c34aa596a3b..f6f6c3512bad 100644 --- a/src/System.Data.Common/src/System/Data/Common/TimeSpanStorage.cs +++ b/src/System.Data.Common/src/System/Data/Common/TimeSpanStorage.cs @@ -256,7 +256,7 @@ public override void SetCapacity(int capacity) TimeSpan[] newValues = new TimeSpan[capacity]; if (null != _values) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; base.SetCapacity(capacity); diff --git a/src/System.Data.Common/src/System/Data/Common/UInt16Storage.cs b/src/System.Data.Common/src/System/Data/Common/UInt16Storage.cs index d0ed60afcfa4..176e163af1d8 100644 --- a/src/System.Data.Common/src/System/Data/Common/UInt16Storage.cs +++ b/src/System.Data.Common/src/System/Data/Common/UInt16Storage.cs @@ -249,7 +249,7 @@ public override void SetCapacity(int capacity) ushort[] newValues = new ushort[capacity]; if (null != _values) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; base.SetCapacity(capacity); diff --git a/src/System.Data.Common/src/System/Data/Common/UInt32Storage.cs b/src/System.Data.Common/src/System/Data/Common/UInt32Storage.cs index 330a185ea419..97cb5ce0f0f2 100644 --- a/src/System.Data.Common/src/System/Data/Common/UInt32Storage.cs +++ b/src/System.Data.Common/src/System/Data/Common/UInt32Storage.cs @@ -248,7 +248,7 @@ public override void SetCapacity(int capacity) uint[] newValues = new uint[capacity]; if (null != _values) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; base.SetCapacity(capacity); diff --git a/src/System.Data.Common/src/System/Data/Common/UInt64Storage.cs b/src/System.Data.Common/src/System/Data/Common/UInt64Storage.cs index 155cc897516f..e4294f6f228b 100644 --- a/src/System.Data.Common/src/System/Data/Common/UInt64Storage.cs +++ b/src/System.Data.Common/src/System/Data/Common/UInt64Storage.cs @@ -239,7 +239,7 @@ public override void SetCapacity(int capacity) ulong[] newValues = new ulong[capacity]; if (null != _values) { - Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); + Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); } _values = newValues; base.SetCapacity(capacity); diff --git a/src/System.Data.Common/src/System/Data/DataError.cs b/src/System.Data.Common/src/System/Data/DataError.cs index ea752b00a988..d0d007c29bf9 100644 --- a/src/System.Data.Common/src/System/Data/DataError.cs +++ b/src/System.Data.Common/src/System/Data/DataError.cs @@ -142,7 +142,7 @@ internal int IndexOf(DataColumn column) { int newCapacity = Math.Min(_count * 2, column.Table.Columns.Count); var biggerList = new ColumnError[newCapacity]; - Array.Copy(_errorList, 0, biggerList, 0, _count); + Array.Copy(_errorList, biggerList, _count); _errorList = biggerList; } return _count; diff --git a/src/System.Data.Common/src/System/Data/DataTable.cs b/src/System.Data.Common/src/System/Data/DataTable.cs index e4181dde0e12..3bafed8c59cc 100644 --- a/src/System.Data.Common/src/System/Data/DataTable.cs +++ b/src/System.Data.Common/src/System/Data/DataTable.cs @@ -3352,7 +3352,7 @@ private IndexField[] NewIndexDesc(DataKey key) Debug.Assert(key.HasValue); IndexField[] indexDesc = key.GetIndexDesc(); IndexField[] newIndexDesc = new IndexField[indexDesc.Length]; - Array.Copy(indexDesc, 0, newIndexDesc, 0, indexDesc.Length); + Array.Copy(indexDesc, newIndexDesc, indexDesc.Length); return newIndexDesc; } diff --git a/src/System.Data.Common/src/System/Data/Filter/FunctionNode.cs b/src/System.Data.Common/src/System/Data/Filter/FunctionNode.cs index 8ba6e7c0eec4..33aa941e3034 100644 --- a/src/System.Data.Common/src/System/Data/Filter/FunctionNode.cs +++ b/src/System.Data.Common/src/System/Data/Filter/FunctionNode.cs @@ -68,7 +68,7 @@ internal void AddArgument(ExpressionNode argument) else if (_argumentCount == _arguments.Length) { ExpressionNode[] bigger = new ExpressionNode[_argumentCount * 2]; - Array.Copy(_arguments, 0, bigger, 0, _argumentCount); + Array.Copy(_arguments, bigger, _argumentCount); _arguments = bigger; } _arguments[_argumentCount++] = argument; diff --git a/src/System.Data.Common/src/System/Data/ProviderBase/SchemaMapping.cs b/src/System.Data.Common/src/System/Data/ProviderBase/SchemaMapping.cs index 2604643c310b..f9e41de02200 100644 --- a/src/System.Data.Common/src/System/Data/ProviderBase/SchemaMapping.cs +++ b/src/System.Data.Common/src/System/Data/ProviderBase/SchemaMapping.cs @@ -518,7 +518,7 @@ private DataColumn[] ResizeColumnArray(DataColumn[] rgcol, int len) Debug.Assert(rgcol != null, "invalid call to ResizeArray"); Debug.Assert(len <= rgcol.Length, "invalid len passed to ResizeArray"); var tmp = new DataColumn[len]; - Array.Copy(rgcol, 0, tmp, 0, len); + Array.Copy(rgcol, tmp, len); return tmp; } diff --git a/src/System.Data.Common/src/System/Data/RbTree.cs b/src/System.Data.Common/src/System/Data/RbTree.cs index 8db016b6d494..6c02513d2db4 100644 --- a/src/System.Data.Common/src/System/Data/RbTree.cs +++ b/src/System.Data.Common/src/System/Data/RbTree.cs @@ -161,9 +161,9 @@ private TreePage AllocPage(int size) { // no free position found, increase pageTable size TreePage[] newPageTable = new TreePage[_pageTable.Length * 2]; - Array.Copy(_pageTable, 0, newPageTable, 0, _pageTable.Length); + Array.Copy(_pageTable, newPageTable, _pageTable.Length); int[] newPageTableMap = new int[(newPageTable.Length + TreePage.slotLineSize - 1) / TreePage.slotLineSize]; - Array.Copy(_pageTableMap, 0, newPageTableMap, 0, _pageTableMap.Length); + Array.Copy(_pageTableMap, newPageTableMap, _pageTableMap.Length); _nextFreePageLine = _pageTableMap.Length; freePageIndex = _pageTable.Length; diff --git a/src/System.Data.Common/src/System/Data/RecordManager.cs b/src/System.Data.Common/src/System/Data/RecordManager.cs index fdf29db5b70a..7bf4394bd14b 100644 --- a/src/System.Data.Common/src/System/Data/RecordManager.cs +++ b/src/System.Data.Common/src/System/Data/RecordManager.cs @@ -37,7 +37,7 @@ private void GrowRecordCapacity() DataRow[] newRows = _table.NewRowArray(_recordCapacity); if (_rows != null) { - Array.Copy(_rows, 0, newRows, 0, Math.Min(_lastFreeRecord, _rows.Length)); + Array.Copy(_rows, newRows, Math.Min(_lastFreeRecord, _rows.Length)); } _rows = newRows; } diff --git a/src/System.Data.Common/src/System/Data/SQLTypes/SQLBytes.cs b/src/System.Data.Common/src/System/Data/SQLTypes/SQLBytes.cs index 88f68c3e61b8..327154cc38bf 100644 --- a/src/System.Data.Common/src/System/Data/SQLTypes/SQLBytes.cs +++ b/src/System.Data.Common/src/System/Data/SQLTypes/SQLBytes.cs @@ -185,7 +185,7 @@ public byte[] Value default: buffer = new byte[_lCurLen]; - Array.Copy(_rgbBuf, 0, buffer, 0, (int)_lCurLen); + Array.Copy(_rgbBuf, buffer, (int)_lCurLen); break; } diff --git a/src/System.Data.Common/src/System/Data/SQLTypes/SQLChars.cs b/src/System.Data.Common/src/System/Data/SQLTypes/SQLChars.cs index d21ebc448512..101220af8514 100644 --- a/src/System.Data.Common/src/System/Data/SQLTypes/SQLChars.cs +++ b/src/System.Data.Common/src/System/Data/SQLTypes/SQLChars.cs @@ -179,7 +179,7 @@ public char[] Value default: buffer = new char[_lCurLen]; - Array.Copy(_rgchBuf, 0, buffer, 0, (int)_lCurLen); + Array.Copy(_rgchBuf, buffer, (int)_lCurLen); break; } diff --git a/src/System.Data.SqlClient/src/Microsoft/SqlServer/Server/SqlRecordBuffer.cs b/src/System.Data.SqlClient/src/Microsoft/SqlServer/Server/SqlRecordBuffer.cs index 7243a38eb37b..1b8dccd00df2 100644 --- a/src/System.Data.SqlClient/src/Microsoft/SqlServer/Server/SqlRecordBuffer.cs +++ b/src/System.Data.SqlClient/src/Microsoft/SqlServer/Server/SqlRecordBuffer.cs @@ -578,7 +578,7 @@ internal int SetChars(long fieldOffset, char[] buffer, int bufferOffset, int len { // dynamic expansion char[] data = new char[Math.Max(ndataIndex + length, 2 * cchars)]; Debug.Assert(CharsLength < int.MaxValue); - Array.Copy((char[])_object, 0, data, 0, (int)CharsLength); + Array.Copy((char[])_object, data, (int)CharsLength); _object = data; } CharsLength = ndataIndex + length; diff --git a/src/System.Data.SqlClient/src/System/Data/SqlClient/TdsParser.cs b/src/System.Data.SqlClient/src/System/Data/SqlClient/TdsParser.cs index be54c890b4c2..ee154b30e8e0 100644 --- a/src/System.Data.SqlClient/src/System/Data/SqlClient/TdsParser.cs +++ b/src/System.Data.SqlClient/src/System/Data/SqlClient/TdsParser.cs @@ -3894,7 +3894,7 @@ internal bool TryProcessTableName(int length, TdsParserStateObject stateObj, out else { MultiPartTableName[] newTables = new MultiPartTableName[tables.Length + 1]; - Array.Copy(tables, 0, newTables, 0, tables.Length); + Array.Copy(tables, newTables, tables.Length); newTables[tables.Length] = mpt; tables = newTables; } diff --git a/src/System.Diagnostics.EventLog/src/System/Diagnostics/EventLog.cs b/src/System.Diagnostics.EventLog/src/System/Diagnostics/EventLog.cs index 5dc05d8f8d7e..0249cb9087af 100644 --- a/src/System.Diagnostics.EventLog/src/System/Diagnostics/EventLog.cs +++ b/src/System.Diagnostics.EventLog/src/System/Diagnostics/EventLog.cs @@ -837,7 +837,7 @@ internal static string TryFormatMessage(SafeLibraryHandle hModule, uint messageN if (largestNumber > insertionStrings.Length) { string[] newStrings = new string[largestNumber]; - Array.Copy(insertionStrings, 0, newStrings, 0, insertionStrings.Length); + Array.Copy(insertionStrings, newStrings, insertionStrings.Length); for (int i = insertionStrings.Length; i < newStrings.Length; i++) { newStrings[i] = "%" + (i + 1); diff --git a/src/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs b/src/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs index 3885c0352093..b12c7ad50f19 100644 --- a/src/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs +++ b/src/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs @@ -166,8 +166,8 @@ private Hashtable CategoryTable { int[] adjustedCounterIndexes = new int[index3]; int[] adjustedHelpIndexes = new int[index3]; - Array.Copy(newCategoryEntry.CounterIndexes, 0, adjustedCounterIndexes, 0, index3); - Array.Copy(newCategoryEntry.HelpIndexes, 0, adjustedHelpIndexes, 0, index3); + Array.Copy(newCategoryEntry.CounterIndexes, adjustedCounterIndexes, index3); + Array.Copy(newCategoryEntry.HelpIndexes, adjustedHelpIndexes, index3); newCategoryEntry.CounterIndexes = adjustedCounterIndexes; newCategoryEntry.HelpIndexes = adjustedHelpIndexes; } @@ -894,7 +894,7 @@ private string[] GetCounters(string category, ref bool categoryExists) if (index2 < counters.Length) { string[] adjustedCounters = new string[index2]; - Array.Copy(counters, 0, adjustedCounters, 0, index2); + Array.Copy(counters, adjustedCounters, index2); counters = adjustedCounters; } diff --git a/src/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Windows.cs b/src/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Windows.cs index 18d31b84f2a4..34fb81986f22 100644 --- a/src/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Windows.cs +++ b/src/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Windows.cs @@ -292,7 +292,7 @@ public static int[] GetProcessIds() break; } int[] ids = new int[size / 4]; - Array.Copy(processIds, 0, ids, 0, ids.Length); + Array.Copy(processIds, ids, ids.Length); return ids; } diff --git a/src/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreKey.cs b/src/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreKey.cs index 21027cb45687..a32b6792788e 100644 --- a/src/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreKey.cs +++ b/src/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreKey.cs @@ -39,7 +39,7 @@ public ADStoreKey(string domainName, byte[] sid) // Make a copy of the SID, since a byte[] is mutable _sid = new byte[sid.Length]; - Array.Copy(sid, 0, _sid, 0, sid.Length); + Array.Copy(sid, _sid, sid.Length); _domainName = domainName; _wellKnownSid = true; diff --git a/src/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMStoreKey.cs b/src/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMStoreKey.cs index 4cf47dd65efe..0de503570b45 100644 --- a/src/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMStoreKey.cs +++ b/src/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMStoreKey.cs @@ -22,7 +22,7 @@ public SAMStoreKey(string machineName, byte[] sid) // Make a copy of the SID, since a byte[] is mutable _sid = new byte[sid.Length]; - Array.Copy(sid, 0, _sid, 0, sid.Length); + Array.Copy(sid, _sid, sid.Length); GlobalDebug.WriteLineIf( GlobalDebug.Info, diff --git a/src/System.IO.Compression/src/System/IO/Compression/DeflateManaged/InflaterManaged.cs b/src/System.IO.Compression/src/System/IO/Compression/DeflateManaged/InflaterManaged.cs index d88e25389cb7..7a611f94f7a0 100644 --- a/src/System.IO.Compression/src/System/IO/Compression/DeflateManaged/InflaterManaged.cs +++ b/src/System.IO.Compression/src/System/IO/Compression/DeflateManaged/InflaterManaged.cs @@ -728,7 +728,7 @@ private bool DecodeDynamicBlockHeader() byte[] distanceTreeCodeLength = new byte[HuffmanTree.MaxDistTreeElements]; // Create literal and distance tables - Array.Copy(_codeList, 0, literalTreeCodeLength, 0, _literalLengthCodeCount); + Array.Copy(_codeList, literalTreeCodeLength, _literalLengthCodeCount); Array.Copy(_codeList, _literalLengthCodeCount, distanceTreeCodeLength, 0, _distanceCodeCount); // Make sure there is an end-of-block code, otherwise how could we ever end? diff --git a/src/System.IO.Pipelines/src/System/IO/Pipelines/PipeCompletion.cs b/src/System.IO.Pipelines/src/System/IO/Pipelines/PipeCompletion.cs index 3baff040c8a2..7b9f0c852378 100644 --- a/src/System.IO.Pipelines/src/System/IO/Pipelines/PipeCompletion.cs +++ b/src/System.IO.Pipelines/src/System/IO/Pipelines/PipeCompletion.cs @@ -78,7 +78,7 @@ private void EnsureSpace() if (newLength == _callbacks.Length) { PipeCompletionCallback[] newArray = s_completionCallbackPool.Rent(_callbacks.Length * 2); - Array.Copy(_callbacks, 0, newArray, 0, _callbacks.Length); + Array.Copy(_callbacks, newArray, _callbacks.Length); s_completionCallbackPool.Return(_callbacks, clearArray: true); _callbacks = newArray; } diff --git a/src/System.IO.Ports/tests/SerialPort/DiscardNull.cs b/src/System.IO.Ports/tests/SerialPort/DiscardNull.cs index 882451153cd9..fa09c8073cba 100644 --- a/src/System.IO.Ports/tests/SerialPort/DiscardNull.cs +++ b/src/System.IO.Ports/tests/SerialPort/DiscardNull.cs @@ -354,7 +354,7 @@ private void VerifyDiscardNull(SerialPort com1, ReadMethodDelegate readMethod, b else { expectedChars = new char[xmitChars.Length]; - Array.Copy(xmitChars, 0, expectedChars, 0, expectedChars.Length); + Array.Copy(xmitChars, expectedChars, expectedChars.Length); } expectedBytes = com1.Encoding.GetBytes(expectedChars); diff --git a/src/System.IO.Ports/tests/SerialPort/ReadChar.cs b/src/System.IO.Ports/tests/SerialPort/ReadChar.cs index b8ec17e55173..f4b14dff99fc 100644 --- a/src/System.IO.Ports/tests/SerialPort/ReadChar.cs +++ b/src/System.IO.Ports/tests/SerialPort/ReadChar.cs @@ -533,7 +533,7 @@ private void VerifyReadBufferedAndNonBuffered(SerialPort com1, SerialPort com2, char[] expectedChars = new char[com1.Encoding.GetCharCount(bytesToWrite, 0, bytesToWrite.Length) * 2]; char[] encodedChars = com1.Encoding.GetChars(bytesToWrite, 0, bytesToWrite.Length); - Array.Copy(encodedChars, 0, expectedChars, 0, bytesToWrite.Length); + Array.Copy(encodedChars, expectedChars, bytesToWrite.Length); Array.Copy(encodedChars, 0, expectedChars, encodedChars.Length, encodedChars.Length); BufferData(com1, com2, bytesToWrite); diff --git a/src/System.IO.Ports/tests/SerialPort/ReadExisting.cs b/src/System.IO.Ports/tests/SerialPort/ReadExisting.cs index bf9ae2f57d4a..32903c3dc44d 100644 --- a/src/System.IO.Ports/tests/SerialPort/ReadExisting.cs +++ b/src/System.IO.Ports/tests/SerialPort/ReadExisting.cs @@ -234,7 +234,7 @@ private void VerifyReadBufferedAndNonBuffered(SerialPort com1, SerialPort com2, char[] expectedChars = new char[com1.Encoding.GetCharCount(bytesToWrite, 0, bytesToWrite.Length) * 2]; char[] encodedChars = com1.Encoding.GetChars(bytesToWrite, 0, bytesToWrite.Length); - Array.Copy(encodedChars, 0, expectedChars, 0, bytesToWrite.Length); + Array.Copy(encodedChars, expectedChars, bytesToWrite.Length); Array.Copy(encodedChars, 0, expectedChars, encodedChars.Length, encodedChars.Length); BufferData(com1, com2, bytesToWrite); diff --git a/src/System.IO.Ports/tests/SerialPort/Read_char_int_int.cs b/src/System.IO.Ports/tests/SerialPort/Read_char_int_int.cs index f3fe32588c3f..2c053c6f4972 100644 --- a/src/System.IO.Ports/tests/SerialPort/Read_char_int_int.cs +++ b/src/System.IO.Ports/tests/SerialPort/Read_char_int_int.cs @@ -448,7 +448,7 @@ public void Read_ResizeBuffer() //[] Fill the buffer up then read in all but one of the chars var expectedChars = new char[charXmitBuffer.Length - 1]; var charRcvBuffer = new char[charXmitBuffer.Length - 1]; - Array.Copy(charXmitBuffer, 0, expectedChars, 0, charXmitBuffer.Length - 1); + Array.Copy(charXmitBuffer, expectedChars, charXmitBuffer.Length - 1); com2.Write(charXmitBuffer, 0, charXmitBuffer.Length); TCSupport.WaitForPredicate(() => com1.BytesToRead == charXmitBuffer.Length, 2000, @@ -635,7 +635,7 @@ public void Read_SurrogateBoundary() char[] actualChars = new char[charXmitBuffer.Length]; - Array.Copy(charRcvBuffer, 0, actualChars, 0, result); + Array.Copy(charRcvBuffer, actualChars, result); result = com1.Read(actualChars, actualChars.Length - 2, 2); Assert.Equal(2, result); @@ -654,7 +654,7 @@ public void Read_SurrogateBoundary() actualChars = new char[charXmitBuffer.Length]; - Array.Copy(charRcvBuffer, 0, actualChars, 0, result); + Array.Copy(charRcvBuffer, actualChars, result); result = com1.Read(actualChars, actualChars.Length - 2, 2); Assert.Equal(2, result); @@ -783,7 +783,7 @@ private void VerifyReadBufferedAndNonBuffered(SerialPort com1, SerialPort com2, char[] expectedChars = new char[com1.Encoding.GetCharCount(bytesToWrite, 0, bytesToWrite.Length) * 2]; char[] encodedChars = com1.Encoding.GetChars(bytesToWrite, 0, bytesToWrite.Length); - Array.Copy(encodedChars, 0, expectedChars, 0, bytesToWrite.Length); + Array.Copy(encodedChars, expectedChars, bytesToWrite.Length); Array.Copy(encodedChars, 0, expectedChars, encodedChars.Length, encodedChars.Length); BufferData(com1, com2, bytesToWrite); diff --git a/src/System.IO.Ports/tests/SerialPort/ReceivedEvent.cs b/src/System.IO.Ports/tests/SerialPort/ReceivedEvent.cs index 60710cd32073..4489fee3f242 100644 --- a/src/System.IO.Ports/tests/SerialPort/ReceivedEvent.cs +++ b/src/System.IO.Ports/tests/SerialPort/ReceivedEvent.cs @@ -428,7 +428,7 @@ public byte[] BytesRead if ((_bytesRead.Length - _numBytesRead) < com.BytesToRead) { byte[] tempByteArray = new byte[Math.Max(_bytesRead.Length * 2, _bytesRead.Length + com.BytesToRead)]; - Array.Copy(_bytesRead, 0, tempByteArray, 0, _numBytesRead); + Array.Copy(_bytesRead, tempByteArray, _numBytesRead); _bytesRead = tempByteArray; } diff --git a/src/System.Linq.Expressions/src/System/Dynamic/ExpandoClass.cs b/src/System.Linq.Expressions/src/System/Dynamic/ExpandoClass.cs index 28f14ef4ac95..6f4097384617 100644 --- a/src/System.Linq.Expressions/src/System/Dynamic/ExpandoClass.cs +++ b/src/System.Linq.Expressions/src/System/Dynamic/ExpandoClass.cs @@ -75,7 +75,7 @@ internal ExpandoClass FindNewClass(string newKey) // no applicable transition, create a new one string[] keys = new string[_keys.Length + 1]; - Array.Copy(_keys, 0, keys, 0, _keys.Length); + Array.Copy(_keys, keys, _keys.Length); keys[_keys.Length] = newKey; ExpandoClass ec = new ExpandoClass(keys, hashCode); diff --git a/src/System.Linq.Expressions/src/System/Dynamic/ExpandoObject.cs b/src/System.Linq.Expressions/src/System/Dynamic/ExpandoObject.cs index d9715ea91190..4a81b5bd4774 100644 --- a/src/System.Linq.Expressions/src/System/Dynamic/ExpandoObject.cs +++ b/src/System.Linq.Expressions/src/System/Dynamic/ExpandoObject.cs @@ -1106,7 +1106,7 @@ internal ExpandoData UpdateClass(ExpandoClass newClass) // we've grown too much - we need a new object array int oldLength = _dataArray.Length; object[] arr = new object[GetAlignedSize(newClass.Keys.Length)]; - Array.Copy(_dataArray, 0, arr, 0, _dataArray.Length); + Array.Copy(_dataArray, arr, _dataArray.Length); ExpandoData newData = new ExpandoData(newClass, arr, _version); newData[oldLength] = ExpandoObject.Uninitialized; return newData; diff --git a/src/System.Linq.Expressions/src/System/Dynamic/Utils/CollectionExtensions.cs b/src/System.Linq.Expressions/src/System/Dynamic/Utils/CollectionExtensions.cs index af8ad7557a1e..b18d95b92958 100644 --- a/src/System.Linq.Expressions/src/System/Dynamic/Utils/CollectionExtensions.cs +++ b/src/System.Linq.Expressions/src/System/Dynamic/Utils/CollectionExtensions.cs @@ -45,7 +45,7 @@ public static T[] RemoveFirst(this T[] array) public static T[] RemoveLast(this T[] array) { T[] result = new T[array.Length - 1]; - Array.Copy(array, 0, result, 0, result.Length); + Array.Copy(array, result, result.Length); return result; } diff --git a/src/System.Linq.Expressions/src/System/Runtime/CompilerServices/ReadOnlyCollectionBuilder.cs b/src/System.Linq.Expressions/src/System/Runtime/CompilerServices/ReadOnlyCollectionBuilder.cs index b243575f7bff..bf669f3facb7 100644 --- a/src/System.Linq.Expressions/src/System/Runtime/CompilerServices/ReadOnlyCollectionBuilder.cs +++ b/src/System.Linq.Expressions/src/System/Runtime/CompilerServices/ReadOnlyCollectionBuilder.cs @@ -94,7 +94,7 @@ public int Capacity T[] newItems = new T[value]; if (_size > 0) { - Array.Copy(_items, 0, newItems, 0, _size); + Array.Copy(_items, newItems, _size); } _items = newItems; } @@ -432,7 +432,7 @@ public void Reverse(int index, int count) public T[] ToArray() { T[] array = new T[_size]; - Array.Copy(_items, 0, array, 0, _size); + Array.Copy(_items, array, _size); return array; } diff --git a/src/System.Linq.Expressions/src/System/Runtime/CompilerServices/RuleCache.cs b/src/System.Linq.Expressions/src/System/Runtime/CompilerServices/RuleCache.cs index d184444841fa..0a780ea54ad4 100644 --- a/src/System.Linq.Expressions/src/System/Runtime/CompilerServices/RuleCache.cs +++ b/src/System.Linq.Expressions/src/System/Runtime/CompilerServices/RuleCache.cs @@ -95,7 +95,7 @@ private static T[] AddOrInsert(T[] rules, T item) else { newRules = new T[newLength]; - Array.Copy(rules, 0, newRules, 0, InsertPosition); + Array.Copy(rules, newRules, InsertPosition); } newRules[InsertPosition] = item; diff --git a/src/System.Linq.Parallel/src/System/Linq/Parallel/Channels/AsynchronousChannel.cs b/src/System.Linq.Parallel/src/System/Linq/Parallel/Channels/AsynchronousChannel.cs index f31f515bd7d5..51bed6e70a0b 100644 --- a/src/System.Linq.Parallel/src/System/Linq/Parallel/Channels/AsynchronousChannel.cs +++ b/src/System.Linq.Parallel/src/System/Linq/Parallel/Channels/AsynchronousChannel.cs @@ -383,7 +383,7 @@ private void FlushCachedChunk() // Trim the partially-full chunk to an array just big enough to hold it. Debug.Assert(1 <= _producerChunkIndex && _producerChunkIndex <= _chunkSize); T[] leftOverChunk = new T[_producerChunkIndex]; - Array.Copy(_producerChunk, 0, leftOverChunk, 0, _producerChunkIndex); + Array.Copy(_producerChunk, leftOverChunk, _producerChunkIndex); // And enqueue the right-sized temporary chunk, possibly blocking if it's full. EnqueueChunk(leftOverChunk); diff --git a/src/System.Linq.Parallel/src/System/Linq/Parallel/Helpers.cs b/src/System.Linq.Parallel/src/System/Linq/Parallel/Helpers.cs index 89be7e896663..c45b6bb93485 100644 --- a/src/System.Linq.Parallel/src/System/Linq/Parallel/Helpers.cs +++ b/src/System.Linq.Parallel/src/System/Linq/Parallel/Helpers.cs @@ -113,7 +113,7 @@ private void Resize() int newSize = checked(_count * 2 + 1); int[] newBuckets = new int[newSize]; Slot[] newSlots = new Slot[newSize]; - Array.Copy(_slots, 0, newSlots, 0, _count); + Array.Copy(_slots, newSlots, _count); for (int i = 0; i < _count; i++) { int bucket = newSlots[i].hashCode % newSize; diff --git a/src/System.Linq.Parallel/src/System/Linq/Parallel/Utils/HashLookup.cs b/src/System.Linq.Parallel/src/System/Linq/Parallel/Utils/HashLookup.cs index 9c1df2afac3a..7521d6772d2e 100644 --- a/src/System.Linq.Parallel/src/System/Linq/Parallel/Utils/HashLookup.cs +++ b/src/System.Linq.Parallel/src/System/Linq/Parallel/Utils/HashLookup.cs @@ -129,7 +129,7 @@ private void Resize() int newSize = checked(count * 2 + 1); int[] newBuckets = new int[newSize]; Slot[] newSlots = new Slot[newSize]; - Array.Copy(slots, 0, newSlots, 0, count); + Array.Copy(slots, newSlots, count); for (int i = 0; i < count; i++) { int bucket = newSlots[i].hashCode % newSize; diff --git a/src/System.Linq.Parallel/src/System/Linq/Parallel/Utils/Sorting.cs b/src/System.Linq.Parallel/src/System/Linq/Parallel/Utils/Sorting.cs index 863943a8d786..92242d4808a9 100644 --- a/src/System.Linq.Parallel/src/System/Linq/Parallel/Utils/Sorting.cs +++ b/src/System.Linq.Parallel/src/System/Linq/Parallel/Utils/Sorting.cs @@ -477,7 +477,7 @@ private void MergeSortCooperatively() // If it's not the last phase, we just bulk propagate the keys and values. if (!isLastPhase && leftCount > 0) { - Array.Copy(myValues, 0, mergedValues, 0, leftCount); + Array.Copy(myValues, mergedValues, leftCount); } // And now just wait for the second half. We never reuse the same barrier across multiple diff --git a/src/System.Linq/src/System/Linq/Set.cs b/src/System.Linq/src/System/Linq/Set.cs index 63c8ba6ff4c1..2be40c52fe5c 100644 --- a/src/System.Linq/src/System/Linq/Set.cs +++ b/src/System.Linq/src/System/Linq/Set.cs @@ -142,7 +142,7 @@ private void Resize() int newSize = checked((_count * 2) + 1); int[] newBuckets = new int[newSize]; Slot[] newSlots = new Slot[newSize]; - Array.Copy(_slots, 0, newSlots, 0, _count); + Array.Copy(_slots, newSlots, _count); for (int i = 0; i < _count; i++) { int bucket = newSlots[i]._hashCode % newSize; diff --git a/src/System.Net.Http/tests/FunctionalTests/HttpContentTest.cs b/src/System.Net.Http/tests/FunctionalTests/HttpContentTest.cs index e01db65fa80f..776df5e3a5dd 100644 --- a/src/System.Net.Http/tests/FunctionalTests/HttpContentTest.cs +++ b/src/System.Net.Http/tests/FunctionalTests/HttpContentTest.cs @@ -507,7 +507,7 @@ private byte[] EncodeStringWithBOM(Encoding encoding, string str) byte[] rawBytes = encoding.GetBytes(str); byte[] preamble = encoding.GetPreamble(); // Get the correct BOM characters byte[] contentBytes = new byte[preamble.Length + rawBytes.Length]; - Array.Copy(preamble, 0, contentBytes, 0, preamble.Length); + Array.Copy(preamble, contentBytes, preamble.Length); Array.Copy(rawBytes, 0, contentBytes, preamble.Length, rawBytes.Length); return contentBytes; } diff --git a/src/System.Numerics.Vectors/tests/GenericVectorTests.cs b/src/System.Numerics.Vectors/tests/GenericVectorTests.cs index 906fb9efe56a..9e0db5beb8b4 100644 --- a/src/System.Numerics.Vectors/tests/GenericVectorTests.cs +++ b/src/System.Numerics.Vectors/tests/GenericVectorTests.cs @@ -1602,7 +1602,7 @@ private void TestVectorEquals() where T : struct } while (Util.AnyEqual(values1, values2)); - Array.Copy(values1, 0, values2, 0, Vector.Count / 2); + Array.Copy(values1, values2, Vector.Count / 2); Vector vec1 = new Vector(values1); Vector vec2 = new Vector(values2); @@ -1647,7 +1647,7 @@ private void TestVectorEqualsAny() where T : struct } while (Util.AnyEqual(values1, values2)); - Array.Copy(values1, 0, values2, 0, Vector.Count / 2); + Array.Copy(values1, values2, Vector.Count / 2); Vector vec1 = new Vector(values1); Vector vec2 = new Vector(values2); @@ -1695,7 +1695,7 @@ private void TestVectorEqualsAll() where T : struct } while (Util.AnyEqual(values1, values2)); - Array.Copy(values1, 0, values2, 0, Vector.Count / 2); + Array.Copy(values1, values2, Vector.Count / 2); Vector vec1 = new Vector(values1); Vector vec2 = new Vector(values2); diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ClassDataContract.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ClassDataContract.cs index f88ffa64f128..5ccc6a75feb4 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ClassDataContract.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ClassDataContract.cs @@ -446,7 +446,7 @@ private XmlDictionaryString[] CreateChildElementNamespaces() int baseChildElementNamespaceCount = (baseChildElementNamespaces != null) ? baseChildElementNamespaces.Length : 0; XmlDictionaryString[] childElementNamespaces = new XmlDictionaryString[Members.Count + baseChildElementNamespaceCount]; if (baseChildElementNamespaceCount > 0) - Array.Copy(baseChildElementNamespaces, 0, childElementNamespaces, 0, baseChildElementNamespaces.Length); + Array.Copy(baseChildElementNamespaces, childElementNamespaces, baseChildElementNamespaces.Length); XmlDictionary dictionary = new XmlDictionary(); for (int i = 0; i < this.Members.Count; i++) @@ -802,12 +802,12 @@ internal ClassDataContractCriticalHelper(Type type) : base(type) { baseMemberCount = BaseContract.MemberNames.Length; MemberNames = new XmlDictionaryString[Members.Count + baseMemberCount]; - Array.Copy(BaseContract.MemberNames, 0, MemberNames, 0, baseMemberCount); + Array.Copy(BaseContract.MemberNames, MemberNames, baseMemberCount); MemberNamespaces = new XmlDictionaryString[Members.Count + baseMemberCount]; - Array.Copy(BaseContract.MemberNamespaces, 0, MemberNamespaces, 0, baseMemberCount); + Array.Copy(BaseContract.MemberNamespaces, MemberNamespaces, baseMemberCount); baseContractCount = BaseContract.ContractNamespaces.Length; ContractNamespaces = new XmlDictionaryString[1 + baseContractCount]; - Array.Copy(BaseContract.ContractNamespaces, 0, ContractNamespaces, 0, baseContractCount); + Array.Copy(BaseContract.ContractNamespaces, ContractNamespaces, baseContractCount); } ContractNamespaces[baseContractCount] = Namespace; for (int i = 0; i < Members.Count; i++) diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ExtensionDataReader.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ExtensionDataReader.cs index 6dd17b5c2cfe..725920f58c94 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ExtensionDataReader.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ExtensionDataReader.cs @@ -465,7 +465,7 @@ private void GrowElementsIfNeeded() else if (_elements.Length == _depth) { ElementData[] newElements = new ElementData[_elements.Length * 2]; - Array.Copy(_elements, 0, newElements, 0, _elements.Length); + Array.Copy(_elements, newElements, _elements.Length); _elements = newElements; } } @@ -549,7 +549,7 @@ private void GrowAttributesIfNeeded() else if (attributes.Length == attributeCount) { AttributeData[] newAttributes = new AttributeData[attributes.Length * 2]; - Array.Copy(attributes, 0, newAttributes, 0, attributes.Length); + Array.Copy(attributes, newAttributes, attributes.Length); attributes = newAttributes; } } diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlJsonReader.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlJsonReader.cs index 69aa7ad606f0..42fee6195012 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlJsonReader.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlJsonReader.cs @@ -1073,7 +1073,7 @@ private void EnterJsonScope(JsonNodeType currentNodeType) else if (_scopes.Length == _scopeDepth) { JsonNodeType[] newScopes = new JsonNodeType[_scopeDepth * 2]; - Array.Copy(_scopes, 0, newScopes, 0, _scopeDepth); + Array.Copy(_scopes, newScopes, _scopeDepth); _scopes = newScopes; } _scopes[_scopeDepth] = currentNodeType; diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlJsonWriter.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlJsonWriter.cs index b78831c03750..5b2c29b0151a 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlJsonWriter.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlJsonWriter.cs @@ -1229,7 +1229,7 @@ private void EnterScope(JsonNodeType currentNodeType) else if (_scopes.Length == _depth) { JsonNodeType[] newScopes = new JsonNodeType[_depth * 2]; - Array.Copy(_scopes, 0, newScopes, 0, _depth); + Array.Copy(_scopes, newScopes, _depth); _scopes = newScopes; } _scopes[_depth] = currentNodeType; diff --git a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlObjectSerializerReadContext.cs b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlObjectSerializerReadContext.cs index f3c9f2f4e8eb..e7e3885f1a77 100644 --- a/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlObjectSerializerReadContext.cs +++ b/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlObjectSerializerReadContext.cs @@ -494,7 +494,7 @@ internal static T[] EnsureArraySize(T[] array, int index) } int newSize = (index < int.MaxValue / 2) ? index * 2 : int.MaxValue; T[] newArray = new T[newSize]; - Array.Copy(array, 0, newArray, 0, array.Length); + Array.Copy(array, newArray, array.Length); array = newArray; } return array; @@ -509,7 +509,7 @@ internal static T[] TrimArraySize(T[] array, int size) if (size != array.Length) { T[] newArray = new T[size]; - Array.Copy(array, 0, newArray, 0, size); + Array.Copy(array, newArray, size); array = newArray; } return array; diff --git a/src/System.Private.DataContractSerialization/src/System/Xml/XmlBaseReader.cs b/src/System.Private.DataContractSerialization/src/System/Xml/XmlBaseReader.cs index 754c60b70931..1aa050d29c3d 100644 --- a/src/System.Private.DataContractSerialization/src/System/Xml/XmlBaseReader.cs +++ b/src/System.Private.DataContractSerialization/src/System/Xml/XmlBaseReader.cs @@ -309,7 +309,7 @@ protected XmlElementNode EnterScope() else if (_elementNodes.Length == _depth) { XmlElementNode[] newElementNodes = new XmlElementNode[_depth * 2]; - Array.Copy(_elementNodes, 0, newElementNodes, 0, _depth); + Array.Copy(_elementNodes, newElementNodes, _depth); _elementNodes = newElementNodes; } XmlElementNode elementNode = _elementNodes[_depth]; @@ -343,7 +343,7 @@ private XmlAttributeNode AddAttribute(QNameType qnameType, bool isAtomicValue) else if (_attributeNodes.Length == attributeIndex) { XmlAttributeNode[] newAttributeNodes = new XmlAttributeNode[attributeIndex * 2]; - Array.Copy(_attributeNodes, 0, newAttributeNodes, 0, attributeIndex); + Array.Copy(_attributeNodes, newAttributeNodes, attributeIndex); _attributeNodes = newAttributeNodes; } XmlAttributeNode attributeNode = _attributeNodes[attributeIndex]; @@ -2900,7 +2900,7 @@ private void AddAttribute() else if (_attributes.Length == _attributeCount) { XmlAttribute[] newAttributes = new XmlAttribute[_attributeCount * 2]; - Array.Copy(_attributes, 0, newAttributes, 0, _attributeCount); + Array.Copy(_attributes, newAttributes, _attributeCount); _attributes = newAttributes; } XmlAttribute attribute = _attributes[_attributeCount]; @@ -2938,7 +2938,7 @@ public Namespace AddNamespace() else if (_namespaces.Length == _nsCount) { Namespace[] newNamespaces = new Namespace[_nsCount * 2]; - Array.Copy(_namespaces, 0, newNamespaces, 0, _nsCount); + Array.Copy(_namespaces, newNamespaces, _nsCount); _namespaces = newNamespaces; } Namespace nameSpace = _namespaces[_nsCount]; diff --git a/src/System.Private.DataContractSerialization/src/System/Xml/XmlBaseWriter.cs b/src/System.Private.DataContractSerialization/src/System/Xml/XmlBaseWriter.cs index dea4ff483aea..e3a008cf14e4 100644 --- a/src/System.Private.DataContractSerialization/src/System/Xml/XmlBaseWriter.cs +++ b/src/System.Private.DataContractSerialization/src/System/Xml/XmlBaseWriter.cs @@ -686,7 +686,7 @@ private Element EnterScope() else if (_elements.Length == _depth) { Element[] newElementNodes = new Element[_depth * 2]; - Array.Copy(_elements, 0, newElementNodes, 0, _depth); + Array.Copy(_elements, newElementNodes, _depth); _elements = newElementNodes; } Element element = _elements[_depth]; @@ -1987,7 +1987,7 @@ private void AddAttribute() else if (_attributes.Length == _attributeCount) { XmlAttribute[] newAttributes = new XmlAttribute[_attributeCount * 2]; - Array.Copy(_attributes, 0, newAttributes, 0, _attributeCount); + Array.Copy(_attributes, newAttributes, _attributeCount); _attributes = newAttributes; } XmlAttribute attribute = _attributes[_attributeCount]; @@ -2081,7 +2081,7 @@ public void AddNamespace(string prefix, string uri, XmlDictionaryString uriDicti if (_namespaces.Length == _nsCount) { Namespace[] newNamespaces = new Namespace[_nsCount * 2]; - Array.Copy(_namespaces, 0, newNamespaces, 0, _nsCount); + Array.Copy(_namespaces, newNamespaces, _nsCount); _namespaces = newNamespaces; } nameSpace = _namespaces[_nsCount]; diff --git a/src/System.Private.DataContractSerialization/src/System/Xml/XmlBinaryReaderSession.cs b/src/System.Private.DataContractSerialization/src/System/Xml/XmlBinaryReaderSession.cs index 57a3921b7cdf..9e49b885327d 100644 --- a/src/System.Private.DataContractSerialization/src/System/Xml/XmlBinaryReaderSession.cs +++ b/src/System.Private.DataContractSerialization/src/System/Xml/XmlBinaryReaderSession.cs @@ -47,7 +47,7 @@ public XmlDictionaryString Add(int id, string value) else if (id >= _strings.Length) { XmlDictionaryString[] newStrings = new XmlDictionaryString[Math.Min(Math.Max(id + 1, _strings.Length * 2), MaxArrayEntries)]; - Array.Copy(_strings, 0, newStrings, 0, _strings.Length); + Array.Copy(_strings, newStrings, _strings.Length); _strings = newStrings; } _strings[id] = xmlString; diff --git a/src/System.Private.DataContractSerialization/src/System/Xml/XmlBinaryWriterSession.cs b/src/System.Private.DataContractSerialization/src/System/Xml/XmlBinaryWriterSession.cs index 9b0084c3cf0f..dbe695d4bb45 100644 --- a/src/System.Private.DataContractSerialization/src/System/Xml/XmlBinaryWriterSession.cs +++ b/src/System.Private.DataContractSerialization/src/System/Xml/XmlBinaryWriterSession.cs @@ -250,7 +250,7 @@ public int this[int index] if (index >= _array.Length) { int[] newArray = new int[Math.Max(index + 1, _array.Length * 2)]; - Array.Copy(_array, 0, newArray, 0, _array.Length); + Array.Copy(_array, newArray, _array.Length); _array = newArray; } diff --git a/src/System.Private.DataContractSerialization/src/System/Xml/XmlCanonicalWriter.cs b/src/System.Private.DataContractSerialization/src/System/Xml/XmlCanonicalWriter.cs index 15a9e6b489b8..5e07fde2fb25 100644 --- a/src/System.Private.DataContractSerialization/src/System/Xml/XmlCanonicalWriter.cs +++ b/src/System.Private.DataContractSerialization/src/System/Xml/XmlCanonicalWriter.cs @@ -164,7 +164,7 @@ private void StartElement() else if (_depth == _scopes.Length) { Scope[] newScopes = new Scope[_depth * 2]; - Array.Copy(_scopes, 0, newScopes, 0, _depth); + Array.Copy(_scopes, newScopes, _depth); _scopes = newScopes; } _scopes[_depth].xmlnsAttributeCount = _xmlnsAttributeCount; @@ -736,7 +736,7 @@ private void AddAttribute(ref Attribute attribute) else if (_attributeCount == _attributes.Length) { Attribute[] newAttributes = new Attribute[_attributeCount * 2]; - Array.Copy(_attributes, 0, newAttributes, 0, _attributeCount); + Array.Copy(_attributes, newAttributes, _attributeCount); _attributes = newAttributes; } @@ -756,7 +756,7 @@ private void AddXmlnsAttribute(ref XmlnsAttribute xmlnsAttribute) else if (_xmlnsAttributes.Length == _xmlnsAttributeCount) { XmlnsAttribute[] newXmlnsAttributes = new XmlnsAttribute[_xmlnsAttributeCount * 2]; - Array.Copy(_xmlnsAttributes, 0, newXmlnsAttributes, 0, _xmlnsAttributeCount); + Array.Copy(_xmlnsAttributes, newXmlnsAttributes, _xmlnsAttributeCount); _xmlnsAttributes = newXmlnsAttributes; } diff --git a/src/System.Private.Xml/src/System/Xml/BinaryXml/XmlBinaryReader.cs b/src/System.Private.Xml/src/System/Xml/BinaryXml/XmlBinaryReader.cs index 84bf039cfac2..f3162b5446db 100644 --- a/src/System.Private.Xml/src/System/Xml/BinaryXml/XmlBinaryReader.cs +++ b/src/System.Private.Xml/src/System/Xml/BinaryXml/XmlBinaryReader.cs @@ -1899,7 +1899,7 @@ private void AddName() if (symNum == symtable.Length) { string[] n = new string[checked(symNum * 2)]; - System.Array.Copy(symtable, 0, n, 0, symNum); + System.Array.Copy(symtable, n, symNum); _symbolTables.symtable = symtable = n; } symtable[symNum] = _xnt.Add(txt); @@ -1915,7 +1915,7 @@ private void AddQName() if (qnameNum == qnametable.Length) { QName[] n = new QName[checked(qnameNum * 2)]; - System.Array.Copy(qnametable, 0, n, 0, qnameNum); + System.Array.Copy(qnametable, n, qnameNum); _symbolTables.qnametable = qnametable = n; } string[] symtable = _symbolTables.symtable; @@ -2418,7 +2418,7 @@ private void GrowElements() int newcount = _elementStack.Length * 2; ElemInfo[] n = new ElemInfo[newcount]; - System.Array.Copy(_elementStack, 0, n, 0, _elementStack.Length); + System.Array.Copy(_elementStack, n, _elementStack.Length); _elementStack = n; } @@ -2427,7 +2427,7 @@ private void GrowAttributes() int newcount = _attributes.Length * 2; AttrInfo[] n = new AttrInfo[newcount]; - System.Array.Copy(_attributes, 0, n, 0, _attrCount); + System.Array.Copy(_attributes, n, _attrCount); _attributes = n; } diff --git a/src/System.Private.Xml/src/System/Xml/BitStack.cs b/src/System.Private.Xml/src/System/Xml/BitStack.cs index fd891b7c5fda..8330fcbdabf3 100644 --- a/src/System.Private.Xml/src/System/Xml/BitStack.cs +++ b/src/System.Private.Xml/src/System/Xml/BitStack.cs @@ -96,7 +96,7 @@ private void PushCurr() if (_stackPos >= len) { uint[] bitStackNew = new uint[2 * len]; - Array.Copy(_bitStack, 0, bitStackNew, 0, len); + Array.Copy(_bitStack, bitStackNew, len); _bitStack = bitStackNew; } } diff --git a/src/System.Private.Xml/src/System/Xml/Core/XmlEncodedRawTextWriter.cs b/src/System.Private.Xml/src/System/Xml/Core/XmlEncodedRawTextWriter.cs index cf4cd69daeb7..5e170f0d817b 100644 --- a/src/System.Private.Xml/src/System/Xml/Core/XmlEncodedRawTextWriter.cs +++ b/src/System.Private.Xml/src/System/Xml/Core/XmlEncodedRawTextWriter.cs @@ -1706,7 +1706,7 @@ private void GrowTextContentMarks() { Debug.Assert(_lastMarkPos + 1 == _textContentMarks.Length); int[] newTextContentMarks = new int[_textContentMarks.Length * 2]; - Array.Copy(_textContentMarks, 0, newTextContentMarks, 0, _textContentMarks.Length); + Array.Copy(_textContentMarks, newTextContentMarks, _textContentMarks.Length); _textContentMarks = newTextContentMarks; } // Write NewLineChars to the specified buffer position and return an updated position. diff --git a/src/System.Private.Xml/src/System/Xml/Core/XmlSubtreeReader.cs b/src/System.Private.Xml/src/System/Xml/Core/XmlSubtreeReader.cs index 43999538ceca..82876f5df9ca 100644 --- a/src/System.Private.Xml/src/System/Xml/Core/XmlSubtreeReader.cs +++ b/src/System.Private.Xml/src/System/Xml/Core/XmlSubtreeReader.cs @@ -1295,7 +1295,7 @@ private void AddNamespace(string prefix, string ns) if (index == _nsAttributes.Length) { NodeData[] newNsAttrs = new NodeData[_nsAttributes.Length * 2]; - Array.Copy(_nsAttributes, 0, newNsAttrs, 0, index); + Array.Copy(_nsAttributes, newNsAttrs, index); _nsAttributes = newNsAttrs; } diff --git a/src/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImpl.cs b/src/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImpl.cs index 13153ea2aee6..11af0012eee4 100644 --- a/src/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImpl.cs +++ b/src/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImpl.cs @@ -7736,7 +7736,7 @@ private NodeData AllocNode(int nodeIndex, int nodeDepth) if (nodeIndex >= _nodes.Length - 1) { NodeData[] newNodes = new NodeData[_nodes.Length * 2]; - Array.Copy(_nodes, 0, newNodes, 0, _nodes.Length); + Array.Copy(_nodes, newNodes, _nodes.Length); _nodes = newNodes; } Debug.Assert(nodeIndex < _nodes.Length); @@ -8190,7 +8190,7 @@ private void PushParsingState() else if (_parsingStatesStackTop + 1 == _parsingStatesStack.Length) { ParsingState[] newParsingStateStack = new ParsingState[_parsingStatesStack.Length * 2]; - Array.Copy(_parsingStatesStack, 0, newParsingStateStack, 0, _parsingStatesStack.Length); + Array.Copy(_parsingStatesStack, newParsingStateStack, _parsingStatesStack.Length); _parsingStatesStack = newParsingStateStack; } _parsingStatesStackTop++; diff --git a/src/System.Private.Xml/src/System/Xml/Core/XmlTextWriter.cs b/src/System.Private.Xml/src/System/Xml/Core/XmlTextWriter.cs index ca3cf1cbd711..d40ef70f06d4 100644 --- a/src/System.Private.Xml/src/System/Xml/Core/XmlTextWriter.cs +++ b/src/System.Private.Xml/src/System/Xml/Core/XmlTextWriter.cs @@ -1507,7 +1507,7 @@ private void AddNamespace(string prefix, string ns, bool declared) if (nsIndex == _nsStack.Length) { Namespace[] newStack = new Namespace[nsIndex * 2]; - Array.Copy(_nsStack, 0, newStack, 0, nsIndex); + Array.Copy(_nsStack, newStack, nsIndex); _nsStack = newStack; } _nsStack[nsIndex].Set(prefix, ns, declared); @@ -1767,7 +1767,7 @@ private void PushStack() if (_top == _stack.Length - 1) { TagInfo[] na = new TagInfo[_stack.Length + 10]; - if (_top > 0) Array.Copy(_stack, 0, na, 0, _top + 1); + if (_top > 0) Array.Copy(_stack, na, _top + 1); _stack = na; } diff --git a/src/System.Private.Xml/src/System/Xml/Core/XmlWellFormedWriter.cs b/src/System.Private.Xml/src/System/Xml/Core/XmlWellFormedWriter.cs index 628f4018d3df..1a1a951663aa 100644 --- a/src/System.Private.Xml/src/System/Xml/Core/XmlWellFormedWriter.cs +++ b/src/System.Private.Xml/src/System/Xml/Core/XmlWellFormedWriter.cs @@ -494,7 +494,7 @@ public override void WriteStartElement(string prefix, string localName, string n if (top == _elemScopeStack.Length) { ElementScope[] newStack = new ElementScope[top * 2]; - Array.Copy(_elemScopeStack, 0, newStack, 0, top); + Array.Copy(_elemScopeStack, newStack, top); _elemScopeStack = newStack; } _elemScopeStack[top].Set(prefix, localName, ns, _nsTop); @@ -1835,7 +1835,7 @@ private void AddNamespace(string prefix, string ns, NamespaceKind kind) if (top == _nsStack.Length) { Namespace[] newStack = new Namespace[top * 2]; - Array.Copy(_nsStack, 0, newStack, 0, top); + Array.Copy(_nsStack, newStack, top); _nsStack = newStack; } _nsStack[top].Set(prefix, ns, kind); @@ -2206,7 +2206,7 @@ private void AddAttribute(string prefix, string localName, string namespaceName) if (top == _attrStack.Length) { AttrName[] newStack = new AttrName[top * 2]; - Array.Copy(_attrStack, 0, newStack, 0, top); + Array.Copy(_attrStack, newStack, top); _attrStack = newStack; } _attrStack[top].Set(prefix, localName, namespaceName); diff --git a/src/System.Private.Xml/src/System/Xml/Core/XmlWellFormedWriterAsync.cs b/src/System.Private.Xml/src/System/Xml/Core/XmlWellFormedWriterAsync.cs index ef51b785e886..5c8bb96723ec 100644 --- a/src/System.Private.Xml/src/System/Xml/Core/XmlWellFormedWriterAsync.cs +++ b/src/System.Private.Xml/src/System/Xml/Core/XmlWellFormedWriterAsync.cs @@ -292,7 +292,7 @@ private void WriteStartElementAsync_FinishWrite(string prefix, string localName, if (top == _elemScopeStack.Length) { ElementScope[] newStack = new ElementScope[top * 2]; - Array.Copy(_elemScopeStack, 0, newStack, 0, top); + Array.Copy(_elemScopeStack, newStack, top); _elemScopeStack = newStack; } _elemScopeStack[top].Set(prefix, localName, ns, _nsTop); diff --git a/src/System.Private.Xml/src/System/Xml/Core/XmlWellFormedWriterHelpers.cs b/src/System.Private.Xml/src/System/Xml/Core/XmlWellFormedWriterHelpers.cs index 0cbc419af14e..111e45da7792 100644 --- a/src/System.Private.Xml/src/System/Xml/Core/XmlWellFormedWriterHelpers.cs +++ b/src/System.Private.Xml/src/System/Xml/Core/XmlWellFormedWriterHelpers.cs @@ -511,7 +511,7 @@ private void AddItem(ItemType type, object data) else if (_items.Length == newItemIndex) { Item[] newItems = new Item[newItemIndex * 2]; - Array.Copy(_items, 0, newItems, 0, newItemIndex); + Array.Copy(_items, newItems, newItemIndex); _items = newItems; } if (_items[newItemIndex] == null) diff --git a/src/System.Private.Xml/src/System/Xml/Core/XsdCachingReader.cs b/src/System.Private.Xml/src/System/Xml/Core/XsdCachingReader.cs index 8260571cdea3..61b7f5222656 100644 --- a/src/System.Private.Xml/src/System/Xml/Core/XsdCachingReader.cs +++ b/src/System.Private.Xml/src/System/Xml/Core/XsdCachingReader.cs @@ -657,7 +657,7 @@ private ValidatingReaderNodeData AddAttribute(int attIndex) if (attIndex >= _attributeEvents.Length - 1) { //reached capacity of array, Need to increase capacity to twice the initial ValidatingReaderNodeData[] newAttributeEvents = new ValidatingReaderNodeData[_attributeEvents.Length * 2]; - Array.Copy(_attributeEvents, 0, newAttributeEvents, 0, _attributeEvents.Length); + Array.Copy(_attributeEvents, newAttributeEvents, _attributeEvents.Length); _attributeEvents = newAttributeEvents; } attInfo = _attributeEvents[attIndex]; @@ -682,7 +682,7 @@ private ValidatingReaderNodeData AddContent(XmlNodeType nodeType) if (_contentIndex >= _contentEvents.Length - 1) { //reached capacity of array, Need to increase capacity to twice the initial ValidatingReaderNodeData[] newContentEvents = new ValidatingReaderNodeData[_contentEvents.Length * 2]; - Array.Copy(_contentEvents, 0, newContentEvents, 0, _contentEvents.Length); + Array.Copy(_contentEvents, newContentEvents, _contentEvents.Length); _contentEvents = newContentEvents; } contentInfo = _contentEvents[_contentIndex]; diff --git a/src/System.Private.Xml/src/System/Xml/Core/XsdValidatingReader.cs b/src/System.Private.Xml/src/System/Xml/Core/XsdValidatingReader.cs index 49137808c559..7a6b5928b545 100644 --- a/src/System.Private.Xml/src/System/Xml/Core/XsdValidatingReader.cs +++ b/src/System.Private.Xml/src/System/Xml/Core/XsdValidatingReader.cs @@ -2180,7 +2180,7 @@ private AttributePSVIInfo AddAttributePSVI(int attIndex) if (attIndex >= _attributePSVINodes.Length - 1) { //reached capacity of PSVIInfo array, Need to increase capacity to twice the initial AttributePSVIInfo[] newPSVINodes = new AttributePSVIInfo[_attributePSVINodes.Length * 2]; - Array.Copy(_attributePSVINodes, 0, newPSVINodes, 0, _attributePSVINodes.Length); + Array.Copy(_attributePSVINodes, newPSVINodes, _attributePSVINodes.Length); _attributePSVINodes = newPSVINodes; } attInfo = _attributePSVINodes[attIndex]; diff --git a/src/System.Private.Xml/src/System/Xml/Dom/DocumentSchemaValidator.cs b/src/System.Private.Xml/src/System/Xml/Dom/DocumentSchemaValidator.cs index 3aaea6f01f56..94c7a02ed901 100644 --- a/src/System.Private.Xml/src/System/Xml/Dom/DocumentSchemaValidator.cs +++ b/src/System.Private.Xml/src/System/Xml/Dom/DocumentSchemaValidator.cs @@ -559,7 +559,7 @@ private void CheckNodeSequenceCapacity(int currentIndex) else if (currentIndex >= _nodeSequenceToValidate.Length - 1) { //reached capacity of array, Need to increase capacity to twice the initial XmlNode[] newNodeSequence = new XmlNode[_nodeSequenceToValidate.Length * 2]; - Array.Copy(_nodeSequenceToValidate, 0, newNodeSequence, 0, _nodeSequenceToValidate.Length); + Array.Copy(_nodeSequenceToValidate, newNodeSequence, _nodeSequenceToValidate.Length); _nodeSequenceToValidate = newNodeSequence; } } diff --git a/src/System.Private.Xml/src/System/Xml/HWStack.cs b/src/System.Private.Xml/src/System/Xml/HWStack.cs index a3d671314c95..4f571403d208 100644 --- a/src/System.Private.Xml/src/System/Xml/HWStack.cs +++ b/src/System.Private.Xml/src/System/Xml/HWStack.cs @@ -38,7 +38,7 @@ internal object Push() object[] newstack = new object[_size + _growthRate]; if (_used > 0) { - System.Array.Copy(_stack, 0, newstack, 0, _used); + System.Array.Copy(_stack, newstack, _used); } _stack = newstack; _size += _growthRate; diff --git a/src/System.Private.Xml/src/System/Xml/Resolvers/XmlPreloadedResolver.cs b/src/System.Private.Xml/src/System/Xml/Resolvers/XmlPreloadedResolver.cs index 4862af7eacbc..6c581bc0bd24 100644 --- a/src/System.Private.Xml/src/System/Xml/Resolvers/XmlPreloadedResolver.cs +++ b/src/System.Private.Xml/src/System/Xml/Resolvers/XmlPreloadedResolver.cs @@ -351,7 +351,7 @@ public void Add(Uri uri, Stream value) } int size = checked((int)ms.Position); byte[] bytes = new byte[size]; - Array.Copy(ms.ToArray(), 0, bytes, 0, size); + Array.Copy(ms.ToArray(), bytes, size); Add(uri, new ByteArrayChunk(bytes)); } } diff --git a/src/System.Private.Xml/src/System/Xml/Schema/BitSet.cs b/src/System.Private.Xml/src/System/Xml/Schema/BitSet.cs index 0b59499dcd44..cbd855505aa5 100644 --- a/src/System.Private.Xml/src/System/Xml/Schema/BitSet.cs +++ b/src/System.Private.Xml/src/System/Xml/Schema/BitSet.cs @@ -243,7 +243,7 @@ private void EnsureLength(int nRequiredLength) if (request < nRequiredLength) request = nRequiredLength; uint[] newBits = new uint[request]; - Array.Copy(_bits, 0, newBits, 0, _bits.Length); + Array.Copy(_bits, newBits, _bits.Length); _bits = newBits; } } diff --git a/src/System.Private.Xml/src/System/Xml/Schema/ContentValidator.cs b/src/System.Private.Xml/src/System/Xml/Schema/ContentValidator.cs index 7f335a398ec1..bd30e492acbb 100644 --- a/src/System.Private.Xml/src/System/Xml/Schema/ContentValidator.cs +++ b/src/System.Private.Xml/src/System/Xml/Schema/ContentValidator.cs @@ -1995,7 +1995,7 @@ public override object ValidateElement(XmlQualifiedName name, ValidationState co { newRPosInfo.rangeCounters = new decimal[_minMaxNodesCount]; } - Array.Copy(rposInfo.rangeCounters, 0, newRPosInfo.rangeCounters, 0, rposInfo.rangeCounters.Length); + Array.Copy(rposInfo.rangeCounters, newRPosInfo.rangeCounters, rposInfo.rangeCounters.Length); decimal count = ++newRPosInfo.rangeCounters[lrNode.Pos]; if (count == lrNode.Max) @@ -2022,7 +2022,7 @@ public override object ValidateElement(XmlQualifiedName name, ValidationState co { newRPosInfo.rangeCounters = new decimal[_minMaxNodesCount]; } - Array.Copy(rposInfo.rangeCounters, 0, newRPosInfo.rangeCounters, 0, rposInfo.rangeCounters.Length); + Array.Copy(rposInfo.rangeCounters, newRPosInfo.rangeCounters, rposInfo.rangeCounters.Length); newRPosInfo.curpos = _followpos[cPos]; newRPosInfo.rangeCounters[lrNode.Pos] = 0; runningPositions[j] = newRPosInfo; diff --git a/src/System.Private.Xml/src/System/Xml/Schema/DtdParser.cs b/src/System.Private.Xml/src/System/Xml/Schema/DtdParser.cs index 0e774c708ad8..749e9a968446 100644 --- a/src/System.Private.Xml/src/System/Xml/Schema/DtdParser.cs +++ b/src/System.Private.Xml/src/System/Xml/Schema/DtdParser.cs @@ -1449,7 +1449,7 @@ private void ParseCondSection() else if (_condSectionEntityIds.Length == _condSectionDepth) { int[] tmp = new int[_condSectionEntityIds.Length * 2]; - Array.Copy(_condSectionEntityIds, 0, tmp, 0, _condSectionEntityIds.Length); + Array.Copy(_condSectionEntityIds, tmp, _condSectionEntityIds.Length); _condSectionEntityIds = tmp; } _condSectionEntityIds[_condSectionDepth] = csEntityId; diff --git a/src/System.Private.Xml/src/System/Xml/Schema/DtdParserAsync.cs b/src/System.Private.Xml/src/System/Xml/Schema/DtdParserAsync.cs index 5dde26ccc4f2..19c6c4fa2360 100644 --- a/src/System.Private.Xml/src/System/Xml/Schema/DtdParserAsync.cs +++ b/src/System.Private.Xml/src/System/Xml/Schema/DtdParserAsync.cs @@ -1061,7 +1061,7 @@ private async Task ParseCondSectionAsync() else if (_condSectionEntityIds.Length == _condSectionDepth) { int[] tmp = new int[_condSectionEntityIds.Length * 2]; - Array.Copy(_condSectionEntityIds, 0, tmp, 0, _condSectionEntityIds.Length); + Array.Copy(_condSectionEntityIds, tmp, _condSectionEntityIds.Length); _condSectionEntityIds = tmp; } _condSectionEntityIds[_condSectionDepth] = csEntityId; diff --git a/src/System.Private.Xml/src/System/Xml/Serialization/Mappings.cs b/src/System.Private.Xml/src/System/Xml/Serialization/Mappings.cs index f112e2c90985..5a7d711c7897 100644 --- a/src/System.Private.Xml/src/System/Xml/Serialization/Mappings.cs +++ b/src/System.Private.Xml/src/System/Xml/Serialization/Mappings.cs @@ -392,7 +392,7 @@ internal ElementAccessor[] ElementsSortedByDerivation if (_elements == null) return null; _sortedElements = new ElementAccessor[_elements.Length]; - Array.Copy(_elements, 0, _sortedElements, 0, _elements.Length); + Array.Copy(_elements, _sortedElements, _elements.Length); AccessorMapping.SortMostToLeastDerived(_sortedElements); return _sortedElements; } @@ -784,7 +784,7 @@ internal ElementAccessor[] ElementsSortedByDerivation if (_elements == null) return null; _sortedElements = new ElementAccessor[_elements.Length]; - Array.Copy(_elements, 0, _sortedElements, 0, _elements.Length); + Array.Copy(_elements, _sortedElements, _elements.Length); SortMostToLeastDerived(_sortedElements); return _sortedElements; } diff --git a/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationGeneratedCode.cs b/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationGeneratedCode.cs index b3a2e9b92eb6..2df87b99ff28 100644 --- a/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationGeneratedCode.cs +++ b/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationGeneratedCode.cs @@ -94,7 +94,7 @@ private TypeMapping[] EnsureArrayIndex(TypeMapping[] a, int index) if (a == null) return new TypeMapping[32]; if (index < a.Length) return a; TypeMapping[] b = new TypeMapping[a.Length + 32]; - Array.Copy(a, 0, b, 0, index); + Array.Copy(a, b, index); return b; } diff --git a/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationILGen.cs b/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationILGen.cs index f5c0376d6ba4..a43228f40ea9 100644 --- a/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationILGen.cs +++ b/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationILGen.cs @@ -136,7 +136,7 @@ private TypeMapping[] EnsureArrayIndex(TypeMapping[] a, int index) if (a == null) return new TypeMapping[32]; if (index < a.Length) return a; TypeMapping[] b = new TypeMapping[a.Length + 32]; - Array.Copy(a, 0, b, 0, index); + Array.Copy(a, b, index); return b; } @@ -594,4 +594,4 @@ internal void ILGenLoad(string source, Type type) } } } -} \ No newline at end of file +} diff --git a/src/System.Private.Xml/src/System/Xml/XmlNamespacemanager.cs b/src/System.Private.Xml/src/System/Xml/XmlNamespacemanager.cs index f0ae20a2e128..567bccca5d57 100644 --- a/src/System.Private.Xml/src/System/Xml/XmlNamespacemanager.cs +++ b/src/System.Private.Xml/src/System/Xml/XmlNamespacemanager.cs @@ -153,7 +153,7 @@ public virtual void AddNamespace(string prefix, string uri) if (_lastDecl == _nsdecls.Length - 1) { NamespaceDeclaration[] newNsdecls = new NamespaceDeclaration[_nsdecls.Length * 2]; - Array.Copy(_nsdecls, 0, newNsdecls, 0, _nsdecls.Length); + Array.Copy(_nsdecls, newNsdecls, _nsdecls.Length); _nsdecls = newNsdecls; } diff --git a/src/System.Private.Xml/src/System/Xml/Xsl/QIL/QilList.cs b/src/System.Private.Xml/src/System/Xml/Xsl/QIL/QilList.cs index 486d8b5ff426..b175f991a4b9 100644 --- a/src/System.Private.Xml/src/System/Xml/Xsl/QIL/QilList.cs +++ b/src/System.Private.Xml/src/System/Xml/Xsl/QIL/QilList.cs @@ -123,7 +123,7 @@ public override void Insert(int index, QilNode node) if (_count == _members.Length) { QilNode[] membersNew = new QilNode[_count * 2]; - Array.Copy(_members, 0, membersNew, 0, _count); + Array.Copy(_members, membersNew, _count); _members = membersNew; } diff --git a/src/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlAttributeCache.cs b/src/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlAttributeCache.cs index be17b5522fc3..68b4492d7e63 100644 --- a/src/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlAttributeCache.cs +++ b/src/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlAttributeCache.cs @@ -363,7 +363,7 @@ private void EnsureAttributeCache() // Resize caching array Debug.Assert(_numEntries == _arrAttrs.Length); AttrNameVal[] arrNew = new AttrNameVal[_numEntries * 2]; - Array.Copy(_arrAttrs, 0, arrNew, 0, _numEntries); + Array.Copy(_arrAttrs, arrNew, _numEntries); _arrAttrs = arrNew; } } diff --git a/src/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlNavigatorStack.cs b/src/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlNavigatorStack.cs index c3e79e1b0136..0cd9bd413665 100644 --- a/src/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlNavigatorStack.cs +++ b/src/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlNavigatorStack.cs @@ -39,7 +39,7 @@ public void Push(XPathNavigator nav) // Resize the stack XPathNavigator[] stkOld = _stkNav; _stkNav = new XPathNavigator[2 * _sp]; - Array.Copy(stkOld, 0, _stkNav, 0, _sp); + Array.Copy(stkOld, _stkNav, _sp); } } diff --git a/src/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlQueryRuntime.cs b/src/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlQueryRuntime.cs index b1a670547b58..fa2741f29495 100644 --- a/src/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlQueryRuntime.cs +++ b/src/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlQueryRuntime.cs @@ -960,7 +960,7 @@ public void AddNewIndex(XPathNavigator context, int indexId, XmlILIndex index) { // Resize array ArrayList[] indexesNew = new ArrayList[indexId + 4]; - Array.Copy(_indexes, 0, indexesNew, 0, _indexes.Length); + Array.Copy(_indexes, indexesNew, _indexes.Length); _indexes = indexesNew; } diff --git a/src/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlSortKeyAccumulator.cs b/src/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlSortKeyAccumulator.cs index c47719e3f032..02eb7aa64bde 100644 --- a/src/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlSortKeyAccumulator.cs +++ b/src/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlSortKeyAccumulator.cs @@ -83,7 +83,7 @@ public void FinishSortKeys() if (_pos >= _keys.Length) { XmlSortKey[] keysNew = new XmlSortKey[_pos * 2]; - Array.Copy(_keys, 0, keysNew, 0, _keys.Length); + Array.Copy(_keys, keysNew, _keys.Length); _keys = keysNew; } _keys[_pos] = null; diff --git a/src/System.Private.Xml/src/System/Xml/Xsl/Xslt/CompilerScopeManager.cs b/src/System.Private.Xml/src/System/Xml/Xsl/Xslt/CompilerScopeManager.cs index 8673f8deacc7..208a8cef99c2 100644 --- a/src/System.Private.Xml/src/System/Xml/Xsl/Xslt/CompilerScopeManager.cs +++ b/src/System.Private.Xml/src/System/Xml/Xsl/Xslt/CompilerScopeManager.cs @@ -136,7 +136,7 @@ private void AddRecord() if (++_lastRecord == _records.Length) { ScopeRecord[] newRecords = new ScopeRecord[_lastRecord * 2]; - Array.Copy(_records, 0, newRecords, 0, _lastRecord); + Array.Copy(_records, newRecords, _lastRecord); _records = newRecords; } // reset scope count: diff --git a/src/System.Private.Xml/src/System/Xml/Xsl/Xslt/OutputScopeManager.cs b/src/System.Private.Xml/src/System/Xml/Xsl/Xslt/OutputScopeManager.cs index 6552f5a8d119..97138a4035cf 100644 --- a/src/System.Private.Xml/src/System/Xml/Xsl/Xslt/OutputScopeManager.cs +++ b/src/System.Private.Xml/src/System/Xml/Xsl/Xslt/OutputScopeManager.cs @@ -71,7 +71,7 @@ private void AddRecord(string prefix, string uri) if (_lastRecord == _records.Length) { ScopeReord[] newRecords = new ScopeReord[_lastRecord * 2]; - Array.Copy(_records, 0, newRecords, 0, _lastRecord); + Array.Copy(_records, newRecords, _lastRecord); _records = newRecords; } _lastScopes = 0; diff --git a/src/System.Private.Xml/src/System/Xml/Xsl/Xslt/XsltInput.cs b/src/System.Private.Xml/src/System/Xml/Xsl/Xslt/XsltInput.cs index 471bcc8c24a3..1b248c379b73 100644 --- a/src/System.Private.Xml/src/System/Xml/Xsl/Xslt/XsltInput.cs +++ b/src/System.Private.Xml/src/System/Xml/Xsl/Xslt/XsltInput.cs @@ -90,7 +90,7 @@ private void ExtendRecordBuffer(int position) newSize = position + 1; } Record[] tmp = new Record[newSize]; - Array.Copy(_records, 0, tmp, 0, _records.Length); + Array.Copy(_records, tmp, _records.Length); _records = tmp; } } diff --git a/src/System.Private.Xml/src/System/Xml/Xsl/XsltOld/BuilderInfo.cs b/src/System.Private.Xml/src/System/Xml/Xsl/XsltOld/BuilderInfo.cs index b2a066d141ac..7514e655c67c 100644 --- a/src/System.Private.Xml/src/System/Xml/Xsl/XsltOld/BuilderInfo.cs +++ b/src/System.Private.Xml/src/System/Xml/Xsl/XsltOld/BuilderInfo.cs @@ -67,7 +67,7 @@ private void EnsureTextInfoSize(int newSize) if (this.TextInfo.Length < newSize) { string[] newArr = new string[newSize * 2]; - Array.Copy(this.TextInfo, 0, newArr, 0, this.TextInfoCount); + Array.Copy(this.TextInfo, newArr, this.TextInfoCount); this.TextInfo = newArr; } } diff --git a/src/System.Reflection.Context/src/System/Reflection/Context/Virtual/VirtualPropertyBase.cs b/src/System.Reflection.Context/src/System/Reflection/Context/Virtual/VirtualPropertyBase.cs index bd81aee02531..747147a21cb0 100644 --- a/src/System.Reflection.Context/src/System/Reflection/Context/Virtual/VirtualPropertyBase.cs +++ b/src/System.Reflection.Context/src/System/Reflection/Context/Virtual/VirtualPropertyBase.cs @@ -122,7 +122,7 @@ public override sealed void SetValue(object obj, object value, BindingFlags invo { args = new object[index.Length + 1]; - Array.Copy(index, 0, args, 0, index.Length); + Array.Copy(index, args, index.Length); args[index.Length] = value; } diff --git a/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs b/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs index f7c6f28cd38c..f738b0eaef4b 100644 --- a/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs +++ b/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs @@ -3016,7 +3016,7 @@ private static unsafe byte[] ObfuscateWithExtraData(byte[] unobfuscated, bool se // copy unobfuscated to obfuscated, leaving room for 4 bytes of data right before the module table. byte[] obfuscated = new byte[unobfuscated.Length + sizeOfExtraData]; - Array.Copy(unobfuscated, 0, obfuscated, 0, offsetToModuleTable); + Array.Copy(unobfuscated, obfuscated, offsetToModuleTable); Array.Copy(unobfuscated, offsetToModuleTable, obfuscated, offsetToModuleTable + sizeOfExtraData, unobfuscated.Length - offsetToModuleTable); fixed (byte* ptr = obfuscated) diff --git a/src/System.Runtime.Numerics/src/System/Numerics/BigInteger.cs b/src/System.Runtime.Numerics/src/System/Numerics/BigInteger.cs index 80c6693df889..42da6808e989 100644 --- a/src/System.Runtime.Numerics/src/System/Numerics/BigInteger.cs +++ b/src/System.Runtime.Numerics/src/System/Numerics/BigInteger.cs @@ -444,7 +444,7 @@ public BigInteger(ReadOnlySpan value, bool isUnsigned = false, bool isBigE { _sign = -1; _bits = new uint[len]; - Array.Copy(val, 0, _bits, 0, len); + Array.Copy(val, _bits, len); } else { @@ -500,7 +500,7 @@ internal BigInteger(uint[] value, bool negative) { _sign = negative ? -1 : +1; _bits = new uint[len]; - Array.Copy(value, 0, _bits, 0, len); + Array.Copy(value, _bits, len); } AssertValid(); } @@ -558,7 +558,7 @@ private BigInteger(uint[] value) { _sign = +1; _bits = new uint[dwordCount]; - Array.Copy(value, 0, _bits, 0, dwordCount); + Array.Copy(value, _bits, dwordCount); } // No trimming is possible. Assign value directly to _bits. else @@ -600,7 +600,7 @@ private BigInteger(uint[] value) { _sign = -1; _bits = new uint[len]; - Array.Copy(value, 0, _bits, 0, len); + Array.Copy(value, _bits, len); } // No trimming is possible. Assign value directly to _bits. else @@ -1449,7 +1449,7 @@ private uint[] ToUInt32Array() bool needExtraByte = (dwords[msb] & 0x80000000) != (highDWord & 0x80000000); uint[] trimmed = new uint[msb + 1 + (needExtraByte ? 1 : 0)]; - Array.Copy(dwords, 0, trimmed, 0, msb + 1); + Array.Copy(dwords, trimmed, msb + 1); if (needExtraByte) trimmed[trimmed.Length - 1] = highDWord; return trimmed; diff --git a/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.BitsBuffer.cs b/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.BitsBuffer.cs index d271843f21b1..669e09673311 100644 --- a/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.BitsBuffer.cs +++ b/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.BitsBuffer.cs @@ -41,7 +41,7 @@ public BitsBuffer(int size, uint[] value) _bits = new uint[size]; _length = ActualLength(value); - Array.Copy(value, 0, _bits, 0, _length); + Array.Copy(value, _bits, _length); } public unsafe void MultiplySelf(ref BitsBuffer value, diff --git a/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.DivRem.cs b/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.DivRem.cs index cb3464ac14fc..78df78eed76b 100644 --- a/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.DivRem.cs +++ b/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.DivRem.cs @@ -319,7 +319,7 @@ private static uint[] CreateCopy(uint[] value) Debug.Assert(value.Length != 0); uint[] bits = new uint[value.Length]; - Array.Copy(value, 0, bits, 0, bits.Length); + Array.Copy(value, bits, bits.Length); return bits; } diff --git a/src/System.Runtime.Numerics/tests/BigInteger/ctor.cs b/src/System.Runtime.Numerics/tests/BigInteger/ctor.cs index f764cf9a78ca..f9b55121b739 100644 --- a/src/System.Runtime.Numerics/tests/BigInteger/ctor.cs +++ b/src/System.Runtime.Numerics/tests/BigInteger/ctor.cs @@ -1060,7 +1060,7 @@ private static void VerifyCtorByteArray(byte[] value) tempBigInteger = bigInteger - (new BigInteger(tempByteArray)); tempByteArray = new byte[8]; - Array.Copy(value, 0, tempByteArray, 0, 8); + Array.Copy(value, tempByteArray, 8); if (!(((tempByteArray[7] & 0x80) == 0) ^ isNeg)) { @@ -1092,7 +1092,7 @@ private static void VerifyCtorByteArray(byte[] value) tempBigInteger = bigInteger - (new BigInteger(tempByteArray)); tempByteArray = new byte[8]; - Array.Copy(value, 0, tempByteArray, 0, 8); + Array.Copy(value, tempByteArray, 8); if ((tempByteArray[7] & 0x80) != 0) { diff --git a/src/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/FormatterServices.cs b/src/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/FormatterServices.cs index 1a77e88e9ed2..dbddcd049401 100644 --- a/src/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/FormatterServices.cs +++ b/src/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/FormatterServices.cs @@ -71,7 +71,7 @@ private static FieldInfo[] InternalGetSerializableMembers(Type type) if (allMembers != null && allMembers.Count > 0) { var membersTemp = new FieldInfo[allMembers.Count + typeMembers.Length]; - Array.Copy(typeMembers, 0, membersTemp, 0, typeMembers.Length); + Array.Copy(typeMembers, membersTemp, typeMembers.Length); allMembers.CopyTo(membersTemp, typeMembers.Length); typeMembers = membersTemp; } diff --git a/src/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryObjectReader.cs b/src/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryObjectReader.cs index 75e2a2645ad4..ce291c467870 100644 --- a/src/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryObjectReader.cs +++ b/src/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryObjectReader.cs @@ -505,7 +505,7 @@ private void NextRectangleMap(ParseRecord pr) pr._rectangularMap[i] = 0; } } - Array.Copy(pr._rectangularMap, 0, pr._indexMap, 0, pr._rank); + Array.Copy(pr._rectangularMap, pr._indexMap, pr._rank); break; } } @@ -552,7 +552,7 @@ private void ParseArrayMember(ParseRecord pr) // Object not instantiated // Array fixup manager int[] fixupIndex = new int[objectPr._rank]; - Array.Copy(objectPr._indexMap, 0, fixupIndex, 0, objectPr._rank); + Array.Copy(objectPr._indexMap, fixupIndex, objectPr._rank); _objectManager.RecordArrayElementFixup(objectPr._objectId, fixupIndex, pr._idRef); } diff --git a/src/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryUtilClasses.cs b/src/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryUtilClasses.cs index 4805dc7ef33b..70da380baa03 100644 --- a/src/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryUtilClasses.cs +++ b/src/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryUtilClasses.cs @@ -177,7 +177,7 @@ internal void IncreaseCapacity() { int size = _objects.Length * 2; object[] newItems = new object[size]; - Array.Copy(_objects, 0, newItems, 0, _objects.Length); + Array.Copy(_objects, newItems, _objects.Length); _objects = newItems; } @@ -261,14 +261,14 @@ internal void IncreaseCapacity(int index) { int size = Math.Max(_negObjects.Length * 2, (-index) + 1); object[] newItems = new object[size]; - Array.Copy(_negObjects, 0, newItems, 0, _negObjects.Length); + Array.Copy(_negObjects, newItems, _negObjects.Length); _negObjects = newItems; } else { int size = Math.Max(_objects.Length * 2, index + 1); object[] newItems = new object[size]; - Array.Copy(_objects, 0, newItems, 0, _objects.Length); + Array.Copy(_objects, newItems, _objects.Length); _objects = newItems; } } @@ -338,14 +338,14 @@ internal void IncreaseCapacity(int index) { int size = Math.Max(_negObjects.Length * 2, (-index) + 1); int[] newItems = new int[size]; - Array.Copy(_negObjects, 0, newItems, 0, _negObjects.Length); + Array.Copy(_negObjects, newItems, _negObjects.Length); _negObjects = newItems; } else { int size = Math.Max(_objects.Length * 2, index + 1); int[] newItems = new int[size]; - Array.Copy(_objects, 0, newItems, 0, _objects.Length); + Array.Copy(_objects, newItems, _objects.Length); _objects = newItems; } } diff --git a/src/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/ObjectManager.cs b/src/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/ObjectManager.cs index a81b61885d99..251749fbd1bf 100644 --- a/src/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/ObjectManager.cs +++ b/src/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/ObjectManager.cs @@ -113,7 +113,7 @@ private void AddObjectHolder(ObjectHolder holder) } ObjectHolder[] temp = new ObjectHolder[newSize]; - Array.Copy(_objects, 0, temp, 0, _objects.Length); + Array.Copy(_objects, temp, _objects.Length); _objects = temp; } @@ -288,7 +288,7 @@ private bool DoValueTypeFixup(FieldInfo memberToFix, ObjectHolder holder, object if ((currentFieldIndex + 1) >= fieldsTemp.Length) { var temp = new FieldInfo[fieldsTemp.Length * 2]; - Array.Copy(fieldsTemp, 0, temp, 0, fieldsTemp.Length); + Array.Copy(fieldsTemp, temp, fieldsTemp.Length); fieldsTemp = temp; } @@ -1418,7 +1418,7 @@ private void EnlargeArray() } FixupHolder[] temp = new FixupHolder[newLength]; - Array.Copy(_values, 0, temp, 0, _count); + Array.Copy(_values, temp, _count); _values = temp; } } @@ -1502,7 +1502,7 @@ private void EnlargeArray() } long[] temp = new long[newLength]; - Array.Copy(_values, 0, temp, 0, _count); + Array.Copy(_values, temp, _count); _values = temp; } } @@ -1545,7 +1545,7 @@ private void EnlargeArray() } ObjectHolder[] temp = new ObjectHolder[newLength]; - Array.Copy(_values, 0, temp, 0, _count); + Array.Copy(_values, temp, _count); _values = temp; } diff --git a/src/System.Runtime.Serialization.Xml/tests/Canonicalization/CryptoCanonicalization/CanonicalWriter.cs b/src/System.Runtime.Serialization.Xml/tests/Canonicalization/CryptoCanonicalization/CanonicalWriter.cs index 12a57d77e924..fee4aae2aada 100644 --- a/src/System.Runtime.Serialization.Xml/tests/Canonicalization/CryptoCanonicalization/CanonicalWriter.cs +++ b/src/System.Runtime.Serialization.Xml/tests/Canonicalization/CryptoCanonicalization/CanonicalWriter.cs @@ -334,7 +334,7 @@ private void PushElement(string prefix, string localName) if (_elementCount == _elements.Length) { ElementEntry[] newElements = new ElementEntry[_elements.Length * 2]; - Array.Copy(_elements, 0, newElements, 0, _elementCount); + Array.Copy(_elements, newElements, _elementCount); _elements = newElements; } _elements[_elementCount++].Set(prefix, localName); @@ -1110,7 +1110,7 @@ public void Add(string prefix, string localName, string namespaceUri, string val if (_count == _list.Length) { AttributeEntry[] newList = new AttributeEntry[_list.Length * 2]; - Array.Copy(_list, 0, newList, 0, _count); + Array.Copy(_list, newList, _count); _list = newList; } diff --git a/src/System.Runtime.Serialization.Xml/tests/SerializationTestTypes/DataContract.cs b/src/System.Runtime.Serialization.Xml/tests/SerializationTestTypes/DataContract.cs index c006f3b6d815..7a77df101d7c 100644 --- a/src/System.Runtime.Serialization.Xml/tests/SerializationTestTypes/DataContract.cs +++ b/src/System.Runtime.Serialization.Xml/tests/SerializationTestTypes/DataContract.cs @@ -874,7 +874,7 @@ public string[][] MemberNames { int baseTypesCount = baseContract.MemberNames.Length; memberNames = new string[baseTypesCount + 1][]; - Array.Copy(baseContract.MemberNames, 0, memberNames, 0, baseTypesCount); + Array.Copy(baseContract.MemberNames, memberNames, baseTypesCount); } string[] declaredMemberNames = new string[Members.Count]; for (int i = 0; i < Members.Count; i++) diff --git a/src/System.Runtime.Serialization.Xml/tests/SerializationTypes.RuntimeOnly.cs b/src/System.Runtime.Serialization.Xml/tests/SerializationTypes.RuntimeOnly.cs index ac15ebe1a31b..97a554404332 100644 --- a/src/System.Runtime.Serialization.Xml/tests/SerializationTypes.RuntimeOnly.cs +++ b/src/System.Runtime.Serialization.Xml/tests/SerializationTypes.RuntimeOnly.cs @@ -3917,7 +3917,7 @@ private class ImplementDictionaryEnumerator : IDictionaryEnumerator public ImplementDictionaryEnumerator(ImplementDictionary sd) { _items = new DictionaryEntry[sd.Count]; - Array.Copy(sd._items, 0, _items, 0, sd.Count); + Array.Copy(sd._items, _items, sd.Count); } public object Current { get { ValidateIndex(); return _items[_index]; } } diff --git a/src/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/TripleDesImplementation.cs b/src/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/TripleDesImplementation.cs index 3d9cd21646e1..da1d4d04ae72 100644 --- a/src/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/TripleDesImplementation.cs +++ b/src/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/TripleDesImplementation.cs @@ -69,7 +69,7 @@ private ICryptoTransform CreateTransform(byte[] rgbKey, byte[] rgbIV, bool encry // Some platforms do not support Two-Key Triple DES, so manually support it here. // Two-Key Triple DES contains two 8-byte keys {K1}{K2} with {K1} appended to make {K1}{K2}{K1}. byte[] newkey = new byte[24]; - Array.Copy(rgbKey, 0, newkey, 0, 16); + Array.Copy(rgbKey, newkey, 16); Array.Copy(rgbKey, 0, newkey, 16, 8); rgbKey = newkey; } diff --git a/src/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/CryptoConfig.cs b/src/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/CryptoConfig.cs index 37c8326bbab1..ebfe8669a20e 100644 --- a/src/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/CryptoConfig.cs +++ b/src/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/CryptoConfig.cs @@ -307,7 +307,7 @@ public static void AddAlgorithm(Type algorithm, params string[] names) throw new ArgumentNullException(nameof(names)); string[] algorithmNames = new string[names.Length]; - Array.Copy(names, 0, algorithmNames, 0, algorithmNames.Length); + Array.Copy(names, algorithmNames, algorithmNames.Length); // Pre-check the algorithm names for validity so that we don't add a few of the names and then // throw an exception if we find an invalid name partway through the list. @@ -459,7 +459,7 @@ public static void AddOID(string oid, params string[] names) throw new ArgumentNullException(nameof(names)); string[] oidNames = new string[names.Length]; - Array.Copy(names, 0, oidNames, 0, oidNames.Length); + Array.Copy(names, oidNames, oidNames.Length); // Pre-check the input names for validity, so that we don't add a few of the names and throw an // exception if an invalid name is found further down the array. diff --git a/src/System.Security.Cryptography.Algorithms/tests/HmacTests.cs b/src/System.Security.Cryptography.Algorithms/tests/HmacTests.cs index 9a6f00f53bea..9de1191c415b 100644 --- a/src/System.Security.Cryptography.Algorithms/tests/HmacTests.cs +++ b/src/System.Security.Cryptography.Algorithms/tests/HmacTests.cs @@ -57,7 +57,7 @@ protected void VerifyHmac( if (truncateSize != -1) { byte[] tmp = new byte[truncateSize]; - Array.Copy(computedDigest, 0, tmp, 0, truncateSize); + Array.Copy(computedDigest, tmp, truncateSize); computedDigest = tmp; } diff --git a/src/System.Security.Cryptography.Cng/src/System/Security/Cryptography/TripleDESCng.cs b/src/System.Security.Cryptography.Cng/src/System/Security/Cryptography/TripleDESCng.cs index 34d631adf02b..78cd22c1df45 100644 --- a/src/System.Security.Cryptography.Cng/src/System/Security/Cryptography/TripleDESCng.cs +++ b/src/System.Security.Cryptography.Cng/src/System/Security/Cryptography/TripleDESCng.cs @@ -124,7 +124,7 @@ byte[] ICngSymmetricAlgorithm.PreprocessKey(byte[] key) // Cng does not support Two-Key Triple DES, so manually support it here for consistency with System.Security.Cryptography.Algorithms. // Two-Key Triple DES contains two 8-byte keys {K1}{K2} with {K1} appended to make {K1}{K2}{K1}. byte[] newkey = new byte[24]; - Array.Copy(key, 0, newkey, 0, 16); + Array.Copy(key, newkey, 16); Array.Copy(key, 0, newkey, 16, 8); return newkey; } diff --git a/src/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/PkcsHelpers.cs b/src/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/PkcsHelpers.cs index 89ceedc5b3cf..1a1c24274a33 100644 --- a/src/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/PkcsHelpers.cs +++ b/src/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/PkcsHelpers.cs @@ -107,7 +107,7 @@ public static void RemoveAt(ref T[] arr, int idx) if (idx != 0) { - Array.Copy(arr, 0, tmp, 0, idx); + Array.Copy(arr, tmp, idx); } if (idx < tmp.Length) diff --git a/src/System.Security.Permissions/src/System/Security/Permissions/PrincipalPermission.cs b/src/System.Security.Permissions/src/System/Security/Permissions/PrincipalPermission.cs index b7d87795e7ec..2f4c7f9f139b 100644 --- a/src/System.Security.Permissions/src/System/Security/Permissions/PrincipalPermission.cs +++ b/src/System.Security.Permissions/src/System/Security/Permissions/PrincipalPermission.cs @@ -189,7 +189,7 @@ public IPermission Union(IPermission other) } IDRole[] idrolesArray = new IDRole[_idArray.Length + operand._idArray.Length]; - Array.Copy(_idArray, 0, idrolesArray, 0, _idArray.Length); + Array.Copy(_idArray, idrolesArray, _idArray.Length); Array.Copy(operand._idArray, 0, idrolesArray, _idArray.Length, operand._idArray.Length); return new PrincipalPermission(idrolesArray); diff --git a/src/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Regex.cs b/src/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Regex.cs index 0a1a3074fe1d..08f744b69877 100644 --- a/src/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Regex.cs +++ b/src/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Regex.cs @@ -315,7 +315,7 @@ public string[] GetGroupNames() else { result = new string[capslist.Length]; - Array.Copy(capslist, 0, result, 0, capslist.Length); + Array.Copy(capslist, result, capslist.Length); } return result; diff --git a/src/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexBoyerMoore.cs b/src/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexBoyerMoore.cs index de0b4786d535..cc427df359c3 100644 --- a/src/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexBoyerMoore.cs +++ b/src/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexBoyerMoore.cs @@ -192,7 +192,7 @@ public RegexBoyerMoore(string pattern, bool caseInsensitive, bool rightToLeft, C if (i == 0) { - Array.Copy(NegativeASCII, 0, newarray, 0, 128); + Array.Copy(NegativeASCII, newarray, 128); NegativeASCII = newarray; } diff --git a/src/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCompiler.cs b/src/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCompiler.cs index 052aee9e153e..bc3339c3452b 100644 --- a/src/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCompiler.cs +++ b/src/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCompiler.cs @@ -160,7 +160,7 @@ private int AddBacktrackNote(int flags, Label l, int codepos) { BacktrackNote[] newnotes = new BacktrackNote[_notes == null ? 16 : _notes.Length * 2]; if (_notes != null) - System.Array.Copy(_notes, 0, newnotes, 0, _notecount); + System.Array.Copy(_notes, newnotes, _notecount); _notes = newnotes; } diff --git a/src/System.Threading.Channels/src/System/Collections/Generic/Deque.cs b/src/System.Threading.Channels/src/System/Collections/Generic/Deque.cs index c68a78aafa5e..28c884864ff8 100644 --- a/src/System.Threading.Channels/src/System/Collections/Generic/Deque.cs +++ b/src/System.Threading.Channels/src/System/Collections/Generic/Deque.cs @@ -108,7 +108,7 @@ private void Grow() if (_head == 0) { - Array.Copy(_array, 0, newArray, 0, _size); + Array.Copy(_array, newArray, _size); } else { diff --git a/src/System.Threading.Tasks.Dataflow/src/Internal/ImmutableArray.cs b/src/System.Threading.Tasks.Dataflow/src/Internal/ImmutableArray.cs index 4ef93e6d71c3..5526dac1409d 100644 --- a/src/System.Threading.Tasks.Dataflow/src/Internal/ImmutableArray.cs +++ b/src/System.Threading.Tasks.Dataflow/src/Internal/ImmutableArray.cs @@ -51,7 +51,7 @@ public ImmutableArray Add(T item) // Copy the elements from this array and the item // to a new array that's returned. var newArray = new T[_array.Length + 1]; - Array.Copy(_array, 0, newArray, 0, _array.Length); + Array.Copy(_array, newArray, _array.Length); newArray[newArray.Length - 1] = item; return new ImmutableArray(newArray); } @@ -70,7 +70,7 @@ public ImmutableArray Remove(T item) // Otherwise, copy the other elements to a new array that's returned. var newArray = new T[_array.Length - 1]; - Array.Copy(_array, 0, newArray, 0, index); + Array.Copy(_array, newArray, index); Array.Copy(_array, index + 1, newArray, index, _array.Length - index - 1); return new ImmutableArray(newArray); } diff --git a/src/System.Threading.Tasks/tests/Task/TaskCancelWaitTest.cs b/src/System.Threading.Tasks/tests/Task/TaskCancelWaitTest.cs index 88724a7e891a..ef985ed0268b 100644 --- a/src/System.Threading.Tasks/tests/Task/TaskCancelWaitTest.cs +++ b/src/System.Threading.Tasks/tests/Task/TaskCancelWaitTest.cs @@ -480,7 +480,7 @@ public TaskInfo(TaskInfo parent, string TaskInfo_CancelWaitName, WorkloadType wo { string[] temp = new string[options.Length - 1]; int excludeIndex = index + 1; - Array.Copy(options, 0, temp, 0, index); + Array.Copy(options, temp, index); int leftToCopy = options.Length - excludeIndex; Array.Copy(options, excludeIndex, temp, index, leftToCopy); diff --git a/src/System.Transactions.Local/src/System/Transactions/Transaction.cs b/src/System.Transactions.Local/src/System/Transactions/Transaction.cs index a21ebf819caf..38e108503298 100644 --- a/src/System.Transactions.Local/src/System/Transactions/Transaction.cs +++ b/src/System.Transactions.Local/src/System/Transactions/Transaction.cs @@ -487,7 +487,7 @@ public byte[] GetPromotedToken() } byte[] toReturn = new byte[internalPromotedToken.Length]; - Array.Copy(internalPromotedToken, 0, toReturn, 0, toReturn.Length); + Array.Copy(internalPromotedToken, toReturn, toReturn.Length); return toReturn; } diff --git a/src/System.Transactions.Local/src/System/Transactions/TransactionInterop.cs b/src/System.Transactions.Local/src/System/Transactions/TransactionInterop.cs index df32da7875ed..c5e85d19d5cd 100644 --- a/src/System.Transactions.Local/src/System/Transactions/TransactionInterop.cs +++ b/src/System.Transactions.Local/src/System/Transactions/TransactionInterop.cs @@ -294,7 +294,7 @@ internal static DistributedTransaction GetDistributedTransactionFromTransmitterP } byte[] propagationTokenCopy = new byte[propagationToken.Length]; - Array.Copy(propagationToken, 0, propagationTokenCopy, 0, propagationToken.Length); + Array.Copy(propagationToken, propagationTokenCopy, propagationToken.Length); return DistributedTransactionManager.GetDistributedTransactionFromTransmitterPropagationToken(propagationTokenCopy); } diff --git a/src/System.Web.HttpUtility/src/System/Web/Util/HttpEncoder.cs b/src/System.Web.HttpUtility/src/System/Web/Util/HttpEncoder.cs index 4c78c760a1eb..a0f2d4a65d4a 100644 --- a/src/System.Web.HttpUtility/src/System/Web/Util/HttpEncoder.cs +++ b/src/System.Web.HttpUtility/src/System/Web/Util/HttpEncoder.cs @@ -287,7 +287,7 @@ internal static string JavaScriptStringEncode(string? value) if (decodedBytesCount < decodedBytes.Length) { byte[] newDecodedBytes = new byte[decodedBytesCount]; - Array.Copy(decodedBytes, 0, newDecodedBytes, 0, decodedBytesCount); + Array.Copy(decodedBytes, newDecodedBytes, decodedBytesCount); decodedBytes = newDecodedBytes; } diff --git a/src/System.Windows.Extensions/src/System/Media/SoundPlayer.cs b/src/System.Windows.Extensions/src/System/Media/SoundPlayer.cs index d65e7b782003..4123850fd14b 100644 --- a/src/System.Windows.Extensions/src/System/Media/SoundPlayer.cs +++ b/src/System.Windows.Extensions/src/System/Media/SoundPlayer.cs @@ -498,7 +498,7 @@ private async Task CopyStreamAsync(CancellationToken cancellationToken) if (_streamData.Length < _currentPos + BlockSize) { byte[] newData = new byte[_streamData.Length * 2]; - Array.Copy(_streamData, 0, newData, 0, _streamData.Length); + Array.Copy(_streamData, newData, _streamData.Length); _streamData = newData; } readBytes = await _stream.ReadAsync(_streamData, _currentPos, BlockSize, cancellationToken).ConfigureAwait(false);