{"action":"created","comment":{"url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/pulls/comments/26853295","id":26853295,"diff_hunk":"@@ -398,6 +398,51 @@ function exportUsergroups() {\n }\n importUsergroups();\n \n+function cacheGroupData() {\n+\tif (Config.groups) {\n+\t\t// Support for old config groups format.\n+\t\t// Should be removed soon.\n+\t\tconsole.log(\"You are using a deprecated version of user group specification in config.\\n\" +\n+\t\t            \"Support for this will be removed soon.\\n\" +\n+\t\t\t\t\t\"Please ensure that you update your config.js to the new format (see config-example.js, line 220)\\n\");\n+\t\tConfig.groupsranking = Config.groupsranking || Object.keys(Config.groups).reverse();\n+\t\treturn false;\n+\t}\n+\tvar grouplist = Config.grouplist;\n+\tvar groups = Config.groups = Object.create(null);\n+\tvar cachedGroups = {};\n+\tConfig.groupsranking = [];\n+\n+\tfunction cacheGroup (sym, groupData) {\n+\t\tif (cachedGroups[sym] === 'processing') return false; // cyclic inheritance.\n+\n+\t\tif (cachedGroups[sym] !== true && groupData['inherit']) {\n+\t\t\tcachedGroups[sym] = 'processing';\n+\t\t\tvar inheritGroup = groups[groupData['inherit']];\n+\t\t\tif (cacheGroup(groupData['inherit'], inheritGroup)) {\n+\t\t\t\tObject.merge(groupData, inheritGroup, false, false);\n+\t\t\t}\n+\t\t\tdelete groupData['inherit'];\n+\t\t}\n+\t\treturn (cachedGroups[sym] = true);\n+\t}\n+\n+\tvar numGroups = grouplist.length;\n+\tfor (var i = 0; i < numGroups; i++) {\n+\t\tvar groupData = grouplist[i];\n+\t\tgroupData.rank = numGroups - i - 1;\n+\t\tgroups[groupData.symbol] = groupData;\n+\t\tConfig.groupsranking.unshift(groupData.symbol);\n+\t}","path":"users.js","position":39,"original_position":39,"commit_id":"f22f66c1b1679392278cb9b9314eebb007b4fa37","original_commit_id":"f22f66c1b1679392278cb9b9314eebb007b4fa37","user":{"login":"Zarel","id":551184,"avatar_url":"https://avatars.githubusercontent.com/u/551184?v=3","gravatar_id":"","url":"https://api.github.com/users/Zarel","html_url":"https://github.com/Zarel","followers_url":"https://api.github.com/users/Zarel/followers","following_url":"https://api.github.com/users/Zarel/following{/other_user}","gists_url":"https://api.github.com/users/Zarel/gists{/gist_id}","starred_url":"https://api.github.com/users/Zarel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zarel/subscriptions","organizations_url":"https://api.github.com/users/Zarel/orgs","repos_url":"https://api.github.com/users/Zarel/repos","events_url":"https://api.github.com/users/Zarel/events{/privacy}","received_events_url":"https://api.github.com/users/Zarel/received_events","type":"User","site_admin":false},"body":"Why don't you just make it backwards compatible? As far as I can tell, all you have to do is wrap lines 430-436 in `if (grouplist)` and move ` = Object.create(null)` from line 412 at the top of the new `if`-block.","created_at":"2015-03-20T16:28:13Z","updated_at":"2015-03-20T16:28:13Z","html_url":"https://github.com/Zarel/Pokemon-Showdown/pull/1634#discussion_r26853295","pull_request_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/pulls/1634","_links":{"self":{"href":"https://api.github.com/repos/Zarel/Pokemon-Showdown/pulls/comments/26853295"},"html":{"href":"https://github.com/Zarel/Pokemon-Showdown/pull/1634#discussion_r26853295"},"pull_request":{"href":"https://api.github.com/repos/Zarel/Pokemon-Showdown/pulls/1634"}}},"pull_request":{"url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/pulls/1634","id":31200531,"html_url":"https://github.com/Zarel/Pokemon-Showdown/pull/1634","diff_url":"https://github.com/Zarel/Pokemon-Showdown/pull/1634.diff","patch_url":"https://github.com/Zarel/Pokemon-Showdown/pull/1634.patch","issue_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/issues/1634","number":1634,"state":"open","locked":false,"title":"cache config groups: optimize user permission checks","user":{"login":"codelegend","id":7265746,"avatar_url":"https://avatars.githubusercontent.com/u/7265746?v=3","gravatar_id":"","url":"https://api.github.com/users/codelegend","html_url":"https://github.com/codelegend","followers_url":"https://api.github.com/users/codelegend/followers","following_url":"https://api.github.com/users/codelegend/following{/other_user}","gists_url":"https://api.github.com/users/codelegend/gists{/gist_id}","starred_url":"https://api.github.com/users/codelegend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codelegend/subscriptions","organizations_url":"https://api.github.com/users/codelegend/orgs","repos_url":"https://api.github.com/users/codelegend/repos","events_url":"https://api.github.com/users/codelegend/events{/privacy}","received_events_url":"https://api.github.com/users/codelegend/received_events","type":"User","site_admin":false},"body":"also removed `Config.groupsranking`, and assigned it while caching.","created_at":"2015-03-15T13:51:31Z","updated_at":"2015-03-20T16:28:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8a5fd1997c1b46fd3d7cc2d6d5d5a0fd3bbd7298","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/pulls/1634/commits","review_comments_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/pulls/1634/comments","review_comment_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/issues/1634/comments","statuses_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/statuses/f22f66c1b1679392278cb9b9314eebb007b4fa37","head":{"label":"codelegend:cache-groups","ref":"cache-groups","sha":"f22f66c1b1679392278cb9b9314eebb007b4fa37","user":{"login":"codelegend","id":7265746,"avatar_url":"https://avatars.githubusercontent.com/u/7265746?v=3","gravatar_id":"","url":"https://api.github.com/users/codelegend","html_url":"https://github.com/codelegend","followers_url":"https://api.github.com/users/codelegend/followers","following_url":"https://api.github.com/users/codelegend/following{/other_user}","gists_url":"https://api.github.com/users/codelegend/gists{/gist_id}","starred_url":"https://api.github.com/users/codelegend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codelegend/subscriptions","organizations_url":"https://api.github.com/users/codelegend/orgs","repos_url":"https://api.github.com/users/codelegend/repos","events_url":"https://api.github.com/users/codelegend/events{/privacy}","received_events_url":"https://api.github.com/users/codelegend/received_events","type":"User","site_admin":false},"repo":{"id":21323500,"name":"Pokemon-Showdown","full_name":"codelegend/Pokemon-Showdown","owner":{"login":"codelegend","id":7265746,"avatar_url":"https://avatars.githubusercontent.com/u/7265746?v=3","gravatar_id":"","url":"https://api.github.com/users/codelegend","html_url":"https://github.com/codelegend","followers_url":"https://api.github.com/users/codelegend/followers","following_url":"https://api.github.com/users/codelegend/following{/other_user}","gists_url":"https://api.github.com/users/codelegend/gists{/gist_id}","starred_url":"https://api.github.com/users/codelegend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codelegend/subscriptions","organizations_url":"https://api.github.com/users/codelegend/orgs","repos_url":"https://api.github.com/users/codelegend/repos","events_url":"https://api.github.com/users/codelegend/events{/privacy}","received_events_url":"https://api.github.com/users/codelegend/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/codelegend/Pokemon-Showdown","description":"Pokémon battle simulator.","fork":true,"url":"https://api.github.com/repos/codelegend/Pokemon-Showdown","forks_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/forks","keys_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/teams","hooks_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/hooks","issue_events_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/issues/events{/number}","events_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/events","assignees_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/assignees{/user}","branches_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/branches{/branch}","tags_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/tags","blobs_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/git/refs{/sha}","trees_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/statuses/{sha}","languages_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/languages","stargazers_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/stargazers","contributors_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/contributors","subscribers_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/subscribers","subscription_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/subscription","commits_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/commits{/sha}","git_commits_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/git/commits{/sha}","comments_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/comments{/number}","issue_comment_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/issues/comments{/number}","contents_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/contents/{+path}","compare_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/merges","archive_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/downloads","issues_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/issues{/number}","pulls_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/pulls{/number}","milestones_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/milestones{/number}","notifications_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/labels{/name}","releases_url":"https://api.github.com/repos/codelegend/Pokemon-Showdown/releases{/id}","created_at":"2014-06-29T13:11:59Z","updated_at":"2015-03-19T18:16:47Z","pushed_at":"2015-03-20T14:10:52Z","git_url":"git://github.com/codelegend/Pokemon-Showdown.git","ssh_url":"git@github.com:codelegend/Pokemon-Showdown.git","clone_url":"https://github.com/codelegend/Pokemon-Showdown.git","svn_url":"https://github.com/codelegend/Pokemon-Showdown","homepage":"http://pokemonshowdown.com","size":32986,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Zarel:master","ref":"master","sha":"5b30ec90780b692f8930a6c84a387fcb7af6abdb","user":{"login":"Zarel","id":551184,"avatar_url":"https://avatars.githubusercontent.com/u/551184?v=3","gravatar_id":"","url":"https://api.github.com/users/Zarel","html_url":"https://github.com/Zarel","followers_url":"https://api.github.com/users/Zarel/followers","following_url":"https://api.github.com/users/Zarel/following{/other_user}","gists_url":"https://api.github.com/users/Zarel/gists{/gist_id}","starred_url":"https://api.github.com/users/Zarel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zarel/subscriptions","organizations_url":"https://api.github.com/users/Zarel/orgs","repos_url":"https://api.github.com/users/Zarel/repos","events_url":"https://api.github.com/users/Zarel/events{/privacy}","received_events_url":"https://api.github.com/users/Zarel/received_events","type":"User","site_admin":false},"repo":{"id":3038446,"name":"Pokemon-Showdown","full_name":"Zarel/Pokemon-Showdown","owner":{"login":"Zarel","id":551184,"avatar_url":"https://avatars.githubusercontent.com/u/551184?v=3","gravatar_id":"","url":"https://api.github.com/users/Zarel","html_url":"https://github.com/Zarel","followers_url":"https://api.github.com/users/Zarel/followers","following_url":"https://api.github.com/users/Zarel/following{/other_user}","gists_url":"https://api.github.com/users/Zarel/gists{/gist_id}","starred_url":"https://api.github.com/users/Zarel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zarel/subscriptions","organizations_url":"https://api.github.com/users/Zarel/orgs","repos_url":"https://api.github.com/users/Zarel/repos","events_url":"https://api.github.com/users/Zarel/events{/privacy}","received_events_url":"https://api.github.com/users/Zarel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Zarel/Pokemon-Showdown","description":"Pokémon battle simulator.","fork":false,"url":"https://api.github.com/repos/Zarel/Pokemon-Showdown","forks_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/forks","keys_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/teams","hooks_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/hooks","issue_events_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/issues/events{/number}","events_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/events","assignees_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/assignees{/user}","branches_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/branches{/branch}","tags_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/tags","blobs_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/git/refs{/sha}","trees_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/statuses/{sha}","languages_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/languages","stargazers_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/stargazers","contributors_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/contributors","subscribers_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/subscribers","subscription_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/subscription","commits_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/commits{/sha}","git_commits_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/git/commits{/sha}","comments_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/comments{/number}","issue_comment_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/issues/comments{/number}","contents_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/contents/{+path}","compare_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/merges","archive_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/downloads","issues_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/issues{/number}","pulls_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/pulls{/number}","milestones_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/milestones{/number}","notifications_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/labels{/name}","releases_url":"https://api.github.com/repos/Zarel/Pokemon-Showdown/releases{/id}","created_at":"2011-12-23T04:52:33Z","updated_at":"2015-03-20T12:20:41Z","pushed_at":"2015-03-20T14:10:53Z","git_url":"git://github.com/Zarel/Pokemon-Showdown.git","ssh_url":"git@github.com:Zarel/Pokemon-Showdown.git","clone_url":"https://github.com/Zarel/Pokemon-Showdown.git","svn_url":"https://github.com/Zarel/Pokemon-Showdown","homepage":"http://pokemonshowdown.com","size":63217,"stargazers_count":479,"watchers_count":479,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":614,"mirror_url":null,"open_issues_count":30,"forks":614,"open_issues":30,"watchers":479,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Zarel/Pokemon-Showdown/pulls/1634"},"html":{"href":"https://github.com/Zarel/Pokemon-Showdown/pull/1634"},"issue":{"href":"https://api.github.com/repos/Zarel/Pokemon-Showdown/issues/1634"},"comments":{"href":"https://api.github.com/repos/Zarel/Pokemon-Showdown/issues/1634/comments"},"review_comments":{"href":"https://api.github.com/repos/Zarel/Pokemon-Showdown/pulls/1634/comments"},"review_comment":{"href":"https://api.github.com/repos/Zarel/Pokemon-Showdown/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Zarel/Pokemon-Showdown/pulls/1634/commits"},"statuses":{"href":"https://api.github.com/repos/Zarel/Pokemon-Showdown/statuses/f22f66c1b1679392278cb9b9314eebb007b4fa37"}}}}