{"action":"created","issue":{"url":"https://api.github.com/repos/svenfuchs/i18n/issues/349","repository_url":"https://api.github.com/repos/svenfuchs/i18n","labels_url":"https://api.github.com/repos/svenfuchs/i18n/issues/349/labels{/name}","comments_url":"https://api.github.com/repos/svenfuchs/i18n/issues/349/comments","events_url":"https://api.github.com/repos/svenfuchs/i18n/issues/349/events","html_url":"https://github.com/svenfuchs/i18n/pull/349","id":189819148,"number":349,"title":"Remove unnecessary frozen hash duplication in HashTransliterator","user":{"login":"czj","id":14306,"avatar_url":"https://avatars.githubusercontent.com/u/14306?v=3","gravatar_id":"","url":"https://api.github.com/users/czj","html_url":"https://github.com/czj","followers_url":"https://api.github.com/users/czj/followers","following_url":"https://api.github.com/users/czj/following{/other_user}","gists_url":"https://api.github.com/users/czj/gists{/gist_id}","starred_url":"https://api.github.com/users/czj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/czj/subscriptions","organizations_url":"https://api.github.com/users/czj/orgs","repos_url":"https://api.github.com/users/czj/repos","events_url":"https://api.github.com/users/czj/events{/privacy}","received_events_url":"https://api.github.com/users/czj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-16T19:36:27Z","updated_at":"2016-11-16T21:24:55Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/svenfuchs/i18n/pulls/349","html_url":"https://github.com/svenfuchs/i18n/pull/349","diff_url":"https://github.com/svenfuchs/i18n/pull/349.diff","patch_url":"https://github.com/svenfuchs/i18n/pull/349.patch"},"body":"HashTransliterator's initialize method creates a copy of the frozen hash containing default approximations, adds its key-value pairs to the approximations hash.\r\n\r\nTo avoid creating this temporary hash that serves no purpose after that, this PR adds a new method that fills the approximations hash directly. In the process, it also skips the unnecessary `to_s` calls on each default keys and values we already know are strings.\r\n\r\nI saw in #184 that a `freeze` call was added to the `DEFAULT_APPROXIMATIONS` constant in a previous commit to solve concurrency issues. @stevenweber mentioned that the problem was that the DEFAULT_APPROXIMATIONS had a changing state between threads. The `add_default_approximations` method does not stringify keys nor values - we already know they are strings - so this should not be a problem anymore."},"comment":{"url":"https://api.github.com/repos/svenfuchs/i18n/issues/comments/261076772","html_url":"https://github.com/svenfuchs/i18n/pull/349#issuecomment-261076772","issue_url":"https://api.github.com/repos/svenfuchs/i18n/issues/349","id":261076772,"user":{"login":"radar","id":2687,"avatar_url":"https://avatars.githubusercontent.com/u/2687?v=3","gravatar_id":"","url":"https://api.github.com/users/radar","html_url":"https://github.com/radar","followers_url":"https://api.github.com/users/radar/followers","following_url":"https://api.github.com/users/radar/following{/other_user}","gists_url":"https://api.github.com/users/radar/gists{/gist_id}","starred_url":"https://api.github.com/users/radar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radar/subscriptions","organizations_url":"https://api.github.com/users/radar/orgs","repos_url":"https://api.github.com/users/radar/repos","events_url":"https://api.github.com/users/radar/events{/privacy}","received_events_url":"https://api.github.com/users/radar/received_events","type":"User","site_admin":false},"created_at":"2016-11-16T21:24:55Z","updated_at":"2016-11-16T21:24:55Z","body":"Thanks @czj. This makes sense to me also."}}
{"actor":{"display_login":"radar"}}