{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Common/issues/74","labels_url":"https://api.github.com/repos/aspnet/Common/issues/74/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Common/issues/74/comments","events_url":"https://api.github.com/repos/aspnet/Common/issues/74/events","html_url":"https://github.com/aspnet/Common/pull/74","id":123831978,"number":74,"title":"Don't use readonly struct in enumerator","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":[{"url":"https://api.github.com/repos/aspnet/Common/labels/cla-already-signed","name":"cla-already-signed","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-24T20:17:15Z","updated_at":"2015-12-25T23:38:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/aspnet/Common/pulls/74","html_url":"https://github.com/aspnet/Common/pull/74","diff_url":"https://github.com/aspnet/Common/pull/74.diff","patch_url":"https://github.com/aspnet/Common/pull/74.patch"},"body":"Ref: http://codeblog.jonskeet.uk/2014/07/16/micro-optimization-the-surprising-inefficiency-of-readonly-fields/"},"comment":{"url":"https://api.github.com/repos/aspnet/Common/issues/comments/167266932","html_url":"https://github.com/aspnet/Common/pull/74#issuecomment-167266932","issue_url":"https://api.github.com/repos/aspnet/Common/issues/74","id":167266932,"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},"created_at":"2015-12-25T23:38:23Z","updated_at":"2015-12-25T23:38:23Z","body":"Before\r\n```il\r\n.method public hidebysig newslot virtual final \r\n        instance bool  MoveNext() cil managed\r\n{\r\n  // Code size       113 (0x71)\r\n  .maxstack  3\r\n  .locals init (string[] V_0,\r\n           string V_1)\r\n  IL_0000:  ldarg.0\r\n  IL_0001:  ldfld      valuetype Microsoft.Extensions.Primitives.StringValues Microsoft.Extensions.Primitives.StringValues/Enumerator::_values\r\n  IL_0006:  ldfld      string[] Microsoft.Extensions.Primitives.StringValues::_values\r\n  IL_000b:  stloc.0\r\n  IL_000c:  ldloc.0\r\n  IL_000d:  brfalse.s  IL_0041\r\n  IL_000f:  ldarg.0\r\n  IL_0010:  ldfld      int32 Microsoft.Extensions.Primitives.StringValues/Enumerator::_index\r\n  IL_0015:  ldloc.0\r\n  IL_0016:  ldlen\r\n  IL_0017:  conv.i4\r\n  IL_0018:  bge.s      IL_0038\r\n  IL_001a:  ldarg.0\r\n  IL_001b:  ldloc.0\r\n  IL_001c:  ldarg.0\r\n  IL_001d:  ldfld      int32 Microsoft.Extensions.Primitives.StringValues/Enumerator::_index\r\n  IL_0022:  ldelem.ref\r\n  IL_0023:  stfld      string Microsoft.Extensions.Primitives.StringValues/Enumerator::_current\r\n  IL_0028:  ldarg.0\r\n  IL_0029:  ldarg.0\r\n  IL_002a:  ldfld      int32 Microsoft.Extensions.Primitives.StringValues/Enumerator::_index\r\n  IL_002f:  ldc.i4.1\r\n  IL_0030:  add\r\n  IL_0031:  stfld      int32 Microsoft.Extensions.Primitives.StringValues/Enumerator::_index\r\n  IL_0036:  ldc.i4.1\r\n  IL_0037:  ret\r\n  IL_0038:  ldarg.0\r\n  IL_0039:  ldnull\r\n  IL_003a:  stfld      string Microsoft.Extensions.Primitives.StringValues/Enumerator::_current\r\n  IL_003f:  ldc.i4.0\r\n  IL_0040:  ret\r\n  IL_0041:  ldarg.0\r\n  IL_0042:  ldfld      valuetype Microsoft.Extensions.Primitives.StringValues Microsoft.Extensions.Primitives.StringValues/Enumerator::_values\r\n  IL_0047:  ldfld      string Microsoft.Extensions.Primitives.StringValues::_value\r\n  IL_004c:  stloc.1\r\n  IL_004d:  ldloc.1\r\n  IL_004e:  brfalse.s  IL_0068\r\n  IL_0050:  ldarg.0\r\n  IL_0051:  ldfld      int32 Microsoft.Extensions.Primitives.StringValues/Enumerator::_index\r\n  IL_0056:  brtrue.s   IL_0068\r\n  IL_0058:  ldarg.0\r\n  IL_0059:  ldloc.1\r\n  IL_005a:  stfld      string Microsoft.Extensions.Primitives.StringValues/Enumerator::_current\r\n  IL_005f:  ldarg.0\r\n  IL_0060:  ldc.i4.m1\r\n  IL_0061:  stfld      int32 Microsoft.Extensions.Primitives.StringValues/Enumerator::_index\r\n  IL_0066:  ldc.i4.1\r\n  IL_0067:  ret\r\n  IL_0068:  ldarg.0\r\n  IL_0069:  ldnull\r\n  IL_006a:  stfld      string Microsoft.Extensions.Primitives.StringValues/Enumerator::_current\r\n  IL_006f:  ldc.i4.0\r\n  IL_0070:  ret\r\n} // end of method Enumerator::MoveNext\r\n```\r\nAfter\r\n```cil\r\n.method public hidebysig newslot virtual final \r\n        instance bool  MoveNext() cil managed\r\n{\r\n  // Code size       96 (0x60)\r\n  .maxstack  3\r\n  IL_0000:  ldarg.0\r\n  IL_0001:  ldfld      int32 Microsoft.Extensions.Primitives.StringValues/Enumerator::_index\r\n  IL_0006:  ldc.i4.0\r\n  IL_0007:  bge.s      IL_000b\r\n  IL_0009:  ldc.i4.0\r\n  IL_000a:  ret\r\n  IL_000b:  ldarg.0\r\n  IL_000c:  ldfld      string[] Microsoft.Extensions.Primitives.StringValues/Enumerator::_values\r\n  IL_0011:  brfalse.s  IL_004f\r\n  IL_0013:  ldarg.0\r\n  IL_0014:  ldfld      int32 Microsoft.Extensions.Primitives.StringValues/Enumerator::_index\r\n  IL_0019:  ldarg.0\r\n  IL_001a:  ldfld      string[] Microsoft.Extensions.Primitives.StringValues/Enumerator::_values\r\n  IL_001f:  ldlen\r\n  IL_0020:  conv.i4\r\n  IL_0021:  bge.s      IL_0046\r\n  IL_0023:  ldarg.0\r\n  IL_0024:  ldarg.0\r\n  IL_0025:  ldfld      string[] Microsoft.Extensions.Primitives.StringValues/Enumerator::_values\r\n  IL_002a:  ldarg.0\r\n  IL_002b:  ldfld      int32 Microsoft.Extensions.Primitives.StringValues/Enumerator::_index\r\n  IL_0030:  ldelem.ref\r\n  IL_0031:  stfld      string Microsoft.Extensions.Primitives.StringValues/Enumerator::_current\r\n  IL_0036:  ldarg.0\r\n  IL_0037:  ldarg.0\r\n  IL_0038:  ldfld      int32 Microsoft.Extensions.Primitives.StringValues/Enumerator::_index\r\n  IL_003d:  ldc.i4.1\r\n  IL_003e:  add\r\n  IL_003f:  stfld      int32 Microsoft.Extensions.Primitives.StringValues/Enumerator::_index\r\n  IL_0044:  ldc.i4.1\r\n  IL_0045:  ret\r\n  IL_0046:  ldarg.0\r\n  IL_0047:  ldc.i4.m1\r\n  IL_0048:  stfld      int32 Microsoft.Extensions.Primitives.StringValues/Enumerator::_index\r\n  IL_004d:  ldc.i4.0\r\n  IL_004e:  ret\r\n  IL_004f:  ldarg.0\r\n  IL_0050:  ldc.i4.m1\r\n  IL_0051:  stfld      int32 Microsoft.Extensions.Primitives.StringValues/Enumerator::_index\r\n  IL_0056:  ldarg.0\r\n  IL_0057:  ldfld      string Microsoft.Extensions.Primitives.StringValues/Enumerator::_current\r\n  IL_005c:  ldnull\r\n  IL_005d:  cgt.un\r\n  IL_005f:  ret\r\n} // end of method Enumerator::MoveNext\r\n```"}}