{"action":"created","issue":{"url":"https://api.github.com/repos/cerner/gc_stats/issues/3","labels_url":"https://api.github.com/repos/cerner/gc_stats/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/cerner/gc_stats/issues/3/comments","events_url":"https://api.github.com/repos/cerner/gc_stats/issues/3/events","html_url":"https://github.com/cerner/gc_stats/issues/3","id":62844599,"number":3,"title":"Is call to '#dup' necessary in GCStats::Middleware?","user":{"login":"nbeyer","id":121554,"avatar_url":"https://avatars.githubusercontent.com/u/121554?v=3","gravatar_id":"","url":"https://api.github.com/users/nbeyer","html_url":"https://github.com/nbeyer","followers_url":"https://api.github.com/users/nbeyer/followers","following_url":"https://api.github.com/users/nbeyer/following{/other_user}","gists_url":"https://api.github.com/users/nbeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/nbeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nbeyer/subscriptions","organizations_url":"https://api.github.com/users/nbeyer/orgs","repos_url":"https://api.github.com/users/nbeyer/repos","events_url":"https://api.github.com/users/nbeyer/events{/privacy}","received_events_url":"https://api.github.com/users/nbeyer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-19T01:41:37Z","updated_at":"2015-03-19T16:07:41Z","closed_at":null,"body":"I may be missing something obvious, but I'm not understanding why GCStats::Middleware is invoking '#dup' and there's no comment to explain it. Here's the code:\r\n\r\n    def call(env)\r\n      dup._call(env)\r\n    end\r\n\r\nIf there's not a specific reason for it, I'll post a PR to remove it."},"comment":{"url":"https://api.github.com/repos/cerner/gc_stats/issues/comments/83645083","html_url":"https://github.com/cerner/gc_stats/issues/3#issuecomment-83645083","issue_url":"https://api.github.com/repos/cerner/gc_stats/issues/3","id":83645083,"user":{"login":"nbeyer","id":121554,"avatar_url":"https://avatars.githubusercontent.com/u/121554?v=3","gravatar_id":"","url":"https://api.github.com/users/nbeyer","html_url":"https://github.com/nbeyer","followers_url":"https://api.github.com/users/nbeyer/followers","following_url":"https://api.github.com/users/nbeyer/following{/other_user}","gists_url":"https://api.github.com/users/nbeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/nbeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nbeyer/subscriptions","organizations_url":"https://api.github.com/users/nbeyer/orgs","repos_url":"https://api.github.com/users/nbeyer/repos","events_url":"https://api.github.com/users/nbeyer/events{/privacy}","received_events_url":"https://api.github.com/users/nbeyer/received_events","type":"User","site_admin":false},"created_at":"2015-03-19T16:07:41Z","updated_at":"2015-03-19T16:07:41Z","body":"I'm going to dig into this a bit more, but I don't see why this is necessary for this middleware. The @app instance variable doesn't seem to be a concern and the other instance variables that this middleware creates are unnecessary (they aren't used in the class anywhere other than the return, so that can be elided).\r\n\r\nEven the answer to that stackoverflow question is contradictory. It says \"yes, you should dup\" for the safety of instance variables created in your middleware, but the question doesn't use instance variables, so the answer seems like it should be \"no, you don't need it, but might in the future if you change something\"."}}