This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Simplify Array.Copy(a, 0, b, 0, c) to Array.Copy(a, b, c)#42343
Merged
stephentoub merged 1 commit intodotnet:masterfrom Nov 4, 2019
Merged
Simplify Array.Copy(a, 0, b, 0, c) to Array.Copy(a, b, c)#42343stephentoub merged 1 commit intodotnet:masterfrom
stephentoub merged 1 commit intodotnet:masterfrom
Conversation
danmoseley
approved these changes
Nov 4, 2019
GrabYourPitchforks
approved these changes
Nov 4, 2019
| // 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); |
Member
There was a problem hiding this comment.
IMO the original code reads a bit cleaner since it's more obvious that the destination array is being written piecemeal. But honestly it's only a weakly held opinion.
| // 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); |
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.
bcf8951 to
0c59d5f
Compare
picenka21
pushed a commit
to picenka21/runtime
that referenced
this pull request
Feb 18, 2022
…efx#42343) 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. Commit migrated from dotnet/corefx@5ac93ba
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
corefx side of dotnet/coreclr#27641.
cc: @jkotas
VS regex search and replace from
Array.Copy\((.+), 0, (.+), 0toArray.Copy($1, $2. The only changes I reverted were those to the tests for Array itself.