{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/36","labels_url":"https://api.github.com/repos/dotnet/coreclr/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/36/comments","events_url":"https://api.github.com/repos/dotnet/coreclr/issues/36/events","html_url":"https://github.com/dotnet/coreclr/pull/36","id":56442062,"number":36,"title":"Avoid unnecessary work for identical locations in Buffer.BlockCopy","user":{"login":"benaadams","id":1142958,"avatar_url":"https://avatars.githubusercontent.com/u/1142958?v=3","gravatar_id":"","url":"https://api.github.com/users/benaadams","html_url":"https://github.com/benaadams","followers_url":"https://api.github.com/users/benaadams/followers","following_url":"https://api.github.com/users/benaadams/following{/other_user}","gists_url":"https://api.github.com/users/benaadams/gists{/gist_id}","starred_url":"https://api.github.com/users/benaadams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benaadams/subscriptions","organizations_url":"https://api.github.com/users/benaadams/orgs","repos_url":"https://api.github.com/users/benaadams/repos","events_url":"https://api.github.com/users/benaadams/events{/privacy}","received_events_url":"https://api.github.com/users/benaadams/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-02-03T21:43:53Z","updated_at":"2015-02-04T19:21:50Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dotnet/coreclr/pulls/36","html_url":"https://github.com/dotnet/coreclr/pull/36","diff_url":"https://github.com/dotnet/coreclr/pull/36.diff","patch_url":"https://github.com/dotnet/coreclr/pull/36.patch"},"body":"Avoid unnecessary work for identical locations in Buffer.BlockCopy\r\n\r\nPerform validity checks to ensure parameters are correct but short-circuit\r\nout memmove when exactly the same data would be copied to the same location.\r\n\r\nThere are a number of occasions; which can be intentional or unintentional, \r\nwhere the buffer being copied is the same place - e.g an internal buffer is \r\nthe same as the return buffer, and there is no need to call memmove's \r\noverwrite safe copy. \r\n\r\nGenerally the call to BlockCopy will be in a library so it is more practical\r\nto enable the check here rather than alter all the calling functions, \r\nincluding 3rd party libraries to preform additional checks."},"comment":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/comments/72919993","html_url":"https://github.com/dotnet/coreclr/pull/36#issuecomment-72919993","issue_url":"https://api.github.com/repos/dotnet/coreclr/issues/36","id":72919993,"user":{"login":"jkotas","id":6668460,"avatar_url":"https://avatars.githubusercontent.com/u/6668460?v=3","gravatar_id":"","url":"https://api.github.com/users/jkotas","html_url":"https://github.com/jkotas","followers_url":"https://api.github.com/users/jkotas/followers","following_url":"https://api.github.com/users/jkotas/following{/other_user}","gists_url":"https://api.github.com/users/jkotas/gists{/gist_id}","starred_url":"https://api.github.com/users/jkotas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkotas/subscriptions","organizations_url":"https://api.github.com/users/jkotas/orgs","repos_url":"https://api.github.com/users/jkotas/repos","events_url":"https://api.github.com/users/jkotas/events{/privacy}","received_events_url":"https://api.github.com/users/jkotas/received_events","type":"User","site_admin":false},"created_at":"2015-02-04T19:21:50Z","updated_at":"2015-02-04T19:21:50Z","body":"LGTM"}}