{"action":"created","comment":{"url":"https://api.github.com/repos/tgstation/tgstation/pulls/comments/92932393","pull_request_review_id":13456163,"id":92932393,"diff_hunk":"@@ -875,10 +875,11 @@ var/list/WALLITEMS_INVERSE = typecacheof(list(\n \n \t\tvar/list/cached_gases = air_contents.gases\n \n-\t\tfor(var/id in cached_gases)\n-\t\t\tvar/gas_concentration = cached_gases[id][MOLES]/total_moles\n-\t\t\tif(id in hardcoded_gases || gas_concentration > 0.001) //ensures the four primary gases are always shown.\n-\t\t\t\tuser << \"<span class='notice'>[cached_gases[id][GAS_META][META_GAS_NAME]]: [round(gas_concentration*100, 0.01)] %</span>\"\n+\t\tfor(var/id = 1 to GAS_LAST)","path":"code/__HELPERS/unsorted.dm","position":8,"original_position":8,"commit_id":"5c87a91d49545611e68ca54745477a134935d689","original_commit_id":"5c87a91d49545611e68ca54745477a134935d689","user":{"login":"RemieRichards","id":4043781,"avatar_url":"https://avatars.githubusercontent.com/u/4043781?v=3","gravatar_id":"","url":"https://api.github.com/users/RemieRichards","html_url":"https://github.com/RemieRichards","followers_url":"https://api.github.com/users/RemieRichards/followers","following_url":"https://api.github.com/users/RemieRichards/following{/other_user}","gists_url":"https://api.github.com/users/RemieRichards/gists{/gist_id}","starred_url":"https://api.github.com/users/RemieRichards/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RemieRichards/subscriptions","organizations_url":"https://api.github.com/users/RemieRichards/orgs","repos_url":"https://api.github.com/users/RemieRichards/repos","events_url":"https://api.github.com/users/RemieRichards/events{/privacy}","received_events_url":"https://api.github.com/users/RemieRichards/received_events","type":"User","site_admin":false},"body":"@optimumtact it's faster than ```for(var/i = X i < Y; X++)```, both the above are, but they're equivalent to each other (near enough)\r\n\r\nso there *are* 3 formats, 2 are fast and one's dogshit, we don't use the dogshit one.","created_at":"2016-12-18T01:49:07Z","updated_at":"2016-12-18T01:49:07Z","html_url":"https://github.com/tgstation/tgstation/pull/22287#discussion_r92932393","pull_request_url":"https://api.github.com/repos/tgstation/tgstation/pulls/22287","_links":{"self":{"href":"https://api.github.com/repos/tgstation/tgstation/pulls/comments/92932393"},"html":{"href":"https://github.com/tgstation/tgstation/pull/22287#discussion_r92932393"},"pull_request":{"href":"https://api.github.com/repos/tgstation/tgstation/pulls/22287"}}},"pull_request":{"url":"https://api.github.com/repos/tgstation/tgstation/pulls/22287","id":98461090,"html_url":"https://github.com/tgstation/tgstation/pull/22287","diff_url":"https://github.com/tgstation/tgstation/pull/22287.diff","patch_url":"https://github.com/tgstation/tgstation/pull/22287.patch","issue_url":"https://api.github.com/repos/tgstation/tgstation/issues/22287","number":22287,"state":"open","locked":false,"title":"Fastmos III.5: Rogue Hashlists","user":{"login":"Cyberboss","id":8171642,"avatar_url":"https://avatars.githubusercontent.com/u/8171642?v=3","gravatar_id":"","url":"https://api.github.com/users/Cyberboss","html_url":"https://github.com/Cyberboss","followers_url":"https://api.github.com/users/Cyberboss/followers","following_url":"https://api.github.com/users/Cyberboss/following{/other_user}","gists_url":"https://api.github.com/users/Cyberboss/gists{/gist_id}","starred_url":"https://api.github.com/users/Cyberboss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cyberboss/subscriptions","organizations_url":"https://api.github.com/users/Cyberboss/orgs","repos_url":"https://api.github.com/users/Cyberboss/repos","events_url":"https://api.github.com/users/Cyberboss/events{/privacy}","received_events_url":"https://api.github.com/users/Cyberboss/received_events","type":"User","site_admin":false},"body":"First off, in order to view the changes without the shitty whole file diffs because of line endings, add `?w=1` to the \"Files Changed\" URL. Quick link: https://github.com/tgstation/tgstation/pull/22287/files?diff=split&w=1\r\n\r\nPerformance diff pending...\r\n\r\nOK, essay time\r\n\r\nFor whatever reason, I lost my mental facilities for a moment and looked at LINDA and saw that /datum/gas_mixture used associative lists.\r\n\r\nSo, after recovering from the resulting alcoholism, I took it up and changed the entire thing to numbered lists. Basic computer science tells us that they are miles faster than the probable hashing that associative lists use.\r\n\r\nSo, let's get down to syntax.\r\n\r\nBefore you'd access gasses like this:\r\n```\r\nvar/datum/gas_mixture/gm = ...\r\nvar/oxy = gm.gases[\"o2\"]\r\nvar/plasma = gm.gases[\"plasma\"]\r\n```\r\nNow you do it like this\r\n```\r\nvar/datum/gas_mixture/gm = ...\r\nvar/oxy = gm.gases[GAS_O2]\r\nvar/plasma = gm.gases[GAS_PLASMA]\r\n```\r\n\r\nLooping through contained gases has changed too, because `in` doesn't work in non-associative lists\r\nOld:\r\n```\r\nvar/cached_gases = gm.gases\r\nfor(var/id in cached_gases)\r\n    ... = cached_gases[id][MOLES]\r\n```\r\nNew:\r\n```\r\nvar/cached_gases = gm.gases\r\nfor(var/id = 1 to GAS_LAST)\r\n    if(!cached_gases[id])  //entries may be null\r\n        continue\r\n   ... = cached_gases[id][MOLES]\r\n```\r\nThis is definitely faster than the `in` syntax even though it has to check every gas\r\n\r\nNote that in map files, gas_filters need to now refer to gas ids by VALUE e.g. `\"n2\"` goes to `2`\r\n\r\nGas strings e.g. `\"o2=22;TEMP=20\"` are unaffected\r\n\r\nAlso added procs for converting between the old and new ids `proc/gasid2shorthand` and `proc/shorthand2gasid' respectively\r\n\r\nOther changes:\r\n- FIXED GAS_MIXTURE/MERGE NOT QDELETING THE MERGED GAS WEW LAD THATS A BIG ONE\r\n- Removed the strong dependencies on the old 4 hard_coded gases (o2,pl,co2,n2)\r\n- Removed chrono_field/assume_air because the only this it did different than the base was leak the gas_mixture\r\n- Fixed tank/blob_act double qdeling the tank\r\n- Fixed an incorrectly set gas filter in pubbystation\r\n\r\nGonna need test merging. I'm 99% sure I got all the runtimes, but just in case.\r\nI'll be watching merged PRs to keep this up to date\r\n\r\n:cl: Cyberboss\r\nexperiment: Fastmos III.5 is here! Enjoy your faster fires and harder spacewinds!\r\n/:cl:\r\n\r\nPlease add a short description of why you think these changes would benefit the game. If you can't justify it in words, it might not be worth adding:\r\n\r\nNo\r\n","created_at":"2016-12-18T01:02:58Z","updated_at":"2016-12-18T01:49:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3520199d7a3cd4ff30ad171e915fbd5cc6db73aa","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/tgstation/tgstation/pulls/22287/commits","review_comments_url":"https://api.github.com/repos/tgstation/tgstation/pulls/22287/comments","review_comment_url":"https://api.github.com/repos/tgstation/tgstation/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tgstation/tgstation/issues/22287/comments","statuses_url":"https://api.github.com/repos/tgstation/tgstation/statuses/5c87a91d49545611e68ca54745477a134935d689","head":{"label":"Cyberboss:AtmosRefactor","ref":"AtmosRefactor","sha":"5c87a91d49545611e68ca54745477a134935d689","user":{"login":"Cyberboss","id":8171642,"avatar_url":"https://avatars.githubusercontent.com/u/8171642?v=3","gravatar_id":"","url":"https://api.github.com/users/Cyberboss","html_url":"https://github.com/Cyberboss","followers_url":"https://api.github.com/users/Cyberboss/followers","following_url":"https://api.github.com/users/Cyberboss/following{/other_user}","gists_url":"https://api.github.com/users/Cyberboss/gists{/gist_id}","starred_url":"https://api.github.com/users/Cyberboss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cyberboss/subscriptions","organizations_url":"https://api.github.com/users/Cyberboss/orgs","repos_url":"https://api.github.com/users/Cyberboss/repos","events_url":"https://api.github.com/users/Cyberboss/events{/privacy}","received_events_url":"https://api.github.com/users/Cyberboss/received_events","type":"User","site_admin":false},"repo":{"id":68404445,"name":"tgstation","full_name":"Cyberboss/tgstation","owner":{"login":"Cyberboss","id":8171642,"avatar_url":"https://avatars.githubusercontent.com/u/8171642?v=3","gravatar_id":"","url":"https://api.github.com/users/Cyberboss","html_url":"https://github.com/Cyberboss","followers_url":"https://api.github.com/users/Cyberboss/followers","following_url":"https://api.github.com/users/Cyberboss/following{/other_user}","gists_url":"https://api.github.com/users/Cyberboss/gists{/gist_id}","starred_url":"https://api.github.com/users/Cyberboss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cyberboss/subscriptions","organizations_url":"https://api.github.com/users/Cyberboss/orgs","repos_url":"https://api.github.com/users/Cyberboss/repos","events_url":"https://api.github.com/users/Cyberboss/events{/privacy}","received_events_url":"https://api.github.com/users/Cyberboss/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Cyberboss/tgstation","description":"the /tg/station branch of SS13","fork":true,"url":"https://api.github.com/repos/Cyberboss/tgstation","forks_url":"https://api.github.com/repos/Cyberboss/tgstation/forks","keys_url":"https://api.github.com/repos/Cyberboss/tgstation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Cyberboss/tgstation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Cyberboss/tgstation/teams","hooks_url":"https://api.github.com/repos/Cyberboss/tgstation/hooks","issue_events_url":"https://api.github.com/repos/Cyberboss/tgstation/issues/events{/number}","events_url":"https://api.github.com/repos/Cyberboss/tgstation/events","assignees_url":"https://api.github.com/repos/Cyberboss/tgstation/assignees{/user}","branches_url":"https://api.github.com/repos/Cyberboss/tgstation/branches{/branch}","tags_url":"https://api.github.com/repos/Cyberboss/tgstation/tags","blobs_url":"https://api.github.com/repos/Cyberboss/tgstation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Cyberboss/tgstation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Cyberboss/tgstation/git/refs{/sha}","trees_url":"https://api.github.com/repos/Cyberboss/tgstation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Cyberboss/tgstation/statuses/{sha}","languages_url":"https://api.github.com/repos/Cyberboss/tgstation/languages","stargazers_url":"https://api.github.com/repos/Cyberboss/tgstation/stargazers","contributors_url":"https://api.github.com/repos/Cyberboss/tgstation/contributors","subscribers_url":"https://api.github.com/repos/Cyberboss/tgstation/subscribers","subscription_url":"https://api.github.com/repos/Cyberboss/tgstation/subscription","commits_url":"https://api.github.com/repos/Cyberboss/tgstation/commits{/sha}","git_commits_url":"https://api.github.com/repos/Cyberboss/tgstation/git/commits{/sha}","comments_url":"https://api.github.com/repos/Cyberboss/tgstation/comments{/number}","issue_comment_url":"https://api.github.com/repos/Cyberboss/tgstation/issues/comments{/number}","contents_url":"https://api.github.com/repos/Cyberboss/tgstation/contents/{+path}","compare_url":"https://api.github.com/repos/Cyberboss/tgstation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Cyberboss/tgstation/merges","archive_url":"https://api.github.com/repos/Cyberboss/tgstation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Cyberboss/tgstation/downloads","issues_url":"https://api.github.com/repos/Cyberboss/tgstation/issues{/number}","pulls_url":"https://api.github.com/repos/Cyberboss/tgstation/pulls{/number}","milestones_url":"https://api.github.com/repos/Cyberboss/tgstation/milestones{/number}","notifications_url":"https://api.github.com/repos/Cyberboss/tgstation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Cyberboss/tgstation/labels{/name}","releases_url":"https://api.github.com/repos/Cyberboss/tgstation/releases{/id}","deployments_url":"https://api.github.com/repos/Cyberboss/tgstation/deployments","created_at":"2016-09-16T18:19:11Z","updated_at":"2016-09-16T18:19:24Z","pushed_at":"2016-12-18T01:15:41Z","git_url":"git://github.com/Cyberboss/tgstation.git","ssh_url":"git@github.com:Cyberboss/tgstation.git","clone_url":"https://github.com/Cyberboss/tgstation.git","svn_url":"https://github.com/Cyberboss/tgstation","homepage":"http://www.tgstation13.org/","size":725526,"stargazers_count":0,"watchers_count":0,"language":"DM","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":"tgstation:master","ref":"master","sha":"64bc659fdd9937c89518dd01b19a93241ecdf77d","user":{"login":"tgstation","id":1363778,"avatar_url":"https://avatars.githubusercontent.com/u/1363778?v=3","gravatar_id":"","url":"https://api.github.com/users/tgstation","html_url":"https://github.com/tgstation","followers_url":"https://api.github.com/users/tgstation/followers","following_url":"https://api.github.com/users/tgstation/following{/other_user}","gists_url":"https://api.github.com/users/tgstation/gists{/gist_id}","starred_url":"https://api.github.com/users/tgstation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgstation/subscriptions","organizations_url":"https://api.github.com/users/tgstation/orgs","repos_url":"https://api.github.com/users/tgstation/repos","events_url":"https://api.github.com/users/tgstation/events{/privacy}","received_events_url":"https://api.github.com/users/tgstation/received_events","type":"Organization","site_admin":false},"repo":{"id":3234987,"name":"tgstation","full_name":"tgstation/tgstation","owner":{"login":"tgstation","id":1363778,"avatar_url":"https://avatars.githubusercontent.com/u/1363778?v=3","gravatar_id":"","url":"https://api.github.com/users/tgstation","html_url":"https://github.com/tgstation","followers_url":"https://api.github.com/users/tgstation/followers","following_url":"https://api.github.com/users/tgstation/following{/other_user}","gists_url":"https://api.github.com/users/tgstation/gists{/gist_id}","starred_url":"https://api.github.com/users/tgstation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgstation/subscriptions","organizations_url":"https://api.github.com/users/tgstation/orgs","repos_url":"https://api.github.com/users/tgstation/repos","events_url":"https://api.github.com/users/tgstation/events{/privacy}","received_events_url":"https://api.github.com/users/tgstation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tgstation/tgstation","description":"the /tg/station branch of SS13","fork":false,"url":"https://api.github.com/repos/tgstation/tgstation","forks_url":"https://api.github.com/repos/tgstation/tgstation/forks","keys_url":"https://api.github.com/repos/tgstation/tgstation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tgstation/tgstation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tgstation/tgstation/teams","hooks_url":"https://api.github.com/repos/tgstation/tgstation/hooks","issue_events_url":"https://api.github.com/repos/tgstation/tgstation/issues/events{/number}","events_url":"https://api.github.com/repos/tgstation/tgstation/events","assignees_url":"https://api.github.com/repos/tgstation/tgstation/assignees{/user}","branches_url":"https://api.github.com/repos/tgstation/tgstation/branches{/branch}","tags_url":"https://api.github.com/repos/tgstation/tgstation/tags","blobs_url":"https://api.github.com/repos/tgstation/tgstation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tgstation/tgstation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tgstation/tgstation/git/refs{/sha}","trees_url":"https://api.github.com/repos/tgstation/tgstation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tgstation/tgstation/statuses/{sha}","languages_url":"https://api.github.com/repos/tgstation/tgstation/languages","stargazers_url":"https://api.github.com/repos/tgstation/tgstation/stargazers","contributors_url":"https://api.github.com/repos/tgstation/tgstation/contributors","subscribers_url":"https://api.github.com/repos/tgstation/tgstation/subscribers","subscription_url":"https://api.github.com/repos/tgstation/tgstation/subscription","commits_url":"https://api.github.com/repos/tgstation/tgstation/commits{/sha}","git_commits_url":"https://api.github.com/repos/tgstation/tgstation/git/commits{/sha}","comments_url":"https://api.github.com/repos/tgstation/tgstation/comments{/number}","issue_comment_url":"https://api.github.com/repos/tgstation/tgstation/issues/comments{/number}","contents_url":"https://api.github.com/repos/tgstation/tgstation/contents/{+path}","compare_url":"https://api.github.com/repos/tgstation/tgstation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tgstation/tgstation/merges","archive_url":"https://api.github.com/repos/tgstation/tgstation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tgstation/tgstation/downloads","issues_url":"https://api.github.com/repos/tgstation/tgstation/issues{/number}","pulls_url":"https://api.github.com/repos/tgstation/tgstation/pulls{/number}","milestones_url":"https://api.github.com/repos/tgstation/tgstation/milestones{/number}","notifications_url":"https://api.github.com/repos/tgstation/tgstation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tgstation/tgstation/labels{/name}","releases_url":"https://api.github.com/repos/tgstation/tgstation/releases{/id}","deployments_url":"https://api.github.com/repos/tgstation/tgstation/deployments","created_at":"2012-01-21T17:32:47Z","updated_at":"2016-12-16T13:12:49Z","pushed_at":"2016-12-18T01:39:38Z","git_url":"git://github.com/tgstation/tgstation.git","ssh_url":"git@github.com:tgstation/tgstation.git","clone_url":"https://github.com/tgstation/tgstation.git","svn_url":"https://github.com/tgstation/tgstation","homepage":"http://www.tgstation13.org/","size":728115,"stargazers_count":336,"watchers_count":336,"language":"DM","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1217,"mirror_url":null,"open_issues_count":908,"forks":1217,"open_issues":908,"watchers":336,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tgstation/tgstation/pulls/22287"},"html":{"href":"https://github.com/tgstation/tgstation/pull/22287"},"issue":{"href":"https://api.github.com/repos/tgstation/tgstation/issues/22287"},"comments":{"href":"https://api.github.com/repos/tgstation/tgstation/issues/22287/comments"},"review_comments":{"href":"https://api.github.com/repos/tgstation/tgstation/pulls/22287/comments"},"review_comment":{"href":"https://api.github.com/repos/tgstation/tgstation/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tgstation/tgstation/pulls/22287/commits"},"statuses":{"href":"https://api.github.com/repos/tgstation/tgstation/statuses/5c87a91d49545611e68ca54745477a134935d689"}}}}
{"actor":{"display_login":"RemieRichards"}}