{"action":"created","comment":{"url":"https://api.github.com/repos/jbowens/jBBCode/pulls/comments/26893085","id":26893085,"diff_hunk":"@@ -97,7 +97,7 @@ public function addBBCode($tagName, $replace, $useOption = false, $parseContent\n      */\n     public function addCodeDefinition(CodeDefinition $definition)\n     {\n-        $this->bbcodes[] = $definition;\n+        $this->bbcodes[$definition->getTagName()][$definition->usesOption()] = $definition;","path":"JBBCode/Parser.php","position":5,"original_position":5,"commit_id":"765dca82d8f7b465c28b4c4085894041e02edeba","original_commit_id":"765dca82d8f7b465c28b4c4085894041e02edeba","user":{"login":"shmax","id":773172,"avatar_url":"https://avatars.githubusercontent.com/u/773172?v=3","gravatar_id":"","url":"https://api.github.com/users/shmax","html_url":"https://github.com/shmax","followers_url":"https://api.github.com/users/shmax/followers","following_url":"https://api.github.com/users/shmax/following{/other_user}","gists_url":"https://api.github.com/users/shmax/gists{/gist_id}","starred_url":"https://api.github.com/users/shmax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shmax/subscriptions","organizations_url":"https://api.github.com/users/shmax/orgs","repos_url":"https://api.github.com/users/shmax/repos","events_url":"https://api.github.com/users/shmax/events{/privacy}","received_events_url":"https://api.github.com/users/shmax/received_events","type":"User","site_admin":false},"body":"Looks great, but I believe this will throw a warning if you don't explicitly initialize the nested array. ","created_at":"2015-03-21T16:00:25Z","updated_at":"2015-03-21T16:00:25Z","html_url":"https://github.com/jbowens/jBBCode/pull/44#discussion_r26893085","pull_request_url":"https://api.github.com/repos/jbowens/jBBCode/pulls/44","_links":{"self":{"href":"https://api.github.com/repos/jbowens/jBBCode/pulls/comments/26893085"},"html":{"href":"https://github.com/jbowens/jBBCode/pull/44#discussion_r26893085"},"pull_request":{"href":"https://api.github.com/repos/jbowens/jBBCode/pulls/44"}}},"pull_request":{"url":"https://api.github.com/repos/jbowens/jBBCode/pulls/44","id":31668720,"html_url":"https://github.com/jbowens/jBBCode/pull/44","diff_url":"https://github.com/jbowens/jBBCode/pull/44.diff","patch_url":"https://github.com/jbowens/jBBCode/pull/44.patch","issue_url":"https://api.github.com/repos/jbowens/jBBCode/issues/44","number":44,"state":"open","locked":false,"title":"[RFC] Faster Lookup for Codes/Tags","user":{"login":"DaSourcerer","id":1443215,"avatar_url":"https://avatars.githubusercontent.com/u/1443215?v=3","gravatar_id":"","url":"https://api.github.com/users/DaSourcerer","html_url":"https://github.com/DaSourcerer","followers_url":"https://api.github.com/users/DaSourcerer/followers","following_url":"https://api.github.com/users/DaSourcerer/following{/other_user}","gists_url":"https://api.github.com/users/DaSourcerer/gists{/gist_id}","starred_url":"https://api.github.com/users/DaSourcerer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DaSourcerer/subscriptions","organizations_url":"https://api.github.com/users/DaSourcerer/orgs","repos_url":"https://api.github.com/users/DaSourcerer/repos","events_url":"https://api.github.com/users/DaSourcerer/events{/privacy}","received_events_url":"https://api.github.com/users/DaSourcerer/received_events","type":"User","site_admin":false},"body":"This PR allows for 𝓞(1) lookups for tags in the parser opposed to the 𝓞(n) lookups currently present.\r\n\r\nIt bears mentioning that this will introduce a behavioural change: ATM the *first* match for a pair of `$tagName` / `$usesOption` is the winning one. After pulling this, the *last* one will win. In addition, this is probably a mere ”feel good” and/or academic change: Performance improvements are only to be expected with very large inputs while having a lot of tags registered.","created_at":"2015-03-21T09:15:18Z","updated_at":"2015-03-21T16:00:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4ac4111663d39d90790621d03edad4e8bcad488b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jbowens/jBBCode/pulls/44/commits","review_comments_url":"https://api.github.com/repos/jbowens/jBBCode/pulls/44/comments","review_comment_url":"https://api.github.com/repos/jbowens/jBBCode/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jbowens/jBBCode/issues/44/comments","statuses_url":"https://api.github.com/repos/jbowens/jBBCode/statuses/765dca82d8f7b465c28b4c4085894041e02edeba","head":{"label":"DaSourcerer:indexed-tag-lookup","ref":"indexed-tag-lookup","sha":"765dca82d8f7b465c28b4c4085894041e02edeba","user":{"login":"DaSourcerer","id":1443215,"avatar_url":"https://avatars.githubusercontent.com/u/1443215?v=3","gravatar_id":"","url":"https://api.github.com/users/DaSourcerer","html_url":"https://github.com/DaSourcerer","followers_url":"https://api.github.com/users/DaSourcerer/followers","following_url":"https://api.github.com/users/DaSourcerer/following{/other_user}","gists_url":"https://api.github.com/users/DaSourcerer/gists{/gist_id}","starred_url":"https://api.github.com/users/DaSourcerer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DaSourcerer/subscriptions","organizations_url":"https://api.github.com/users/DaSourcerer/orgs","repos_url":"https://api.github.com/users/DaSourcerer/repos","events_url":"https://api.github.com/users/DaSourcerer/events{/privacy}","received_events_url":"https://api.github.com/users/DaSourcerer/received_events","type":"User","site_admin":false},"repo":{"id":32277699,"name":"jBBCode","full_name":"DaSourcerer/jBBCode","owner":{"login":"DaSourcerer","id":1443215,"avatar_url":"https://avatars.githubusercontent.com/u/1443215?v=3","gravatar_id":"","url":"https://api.github.com/users/DaSourcerer","html_url":"https://github.com/DaSourcerer","followers_url":"https://api.github.com/users/DaSourcerer/followers","following_url":"https://api.github.com/users/DaSourcerer/following{/other_user}","gists_url":"https://api.github.com/users/DaSourcerer/gists{/gist_id}","starred_url":"https://api.github.com/users/DaSourcerer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DaSourcerer/subscriptions","organizations_url":"https://api.github.com/users/DaSourcerer/orgs","repos_url":"https://api.github.com/users/DaSourcerer/repos","events_url":"https://api.github.com/users/DaSourcerer/events{/privacy}","received_events_url":"https://api.github.com/users/DaSourcerer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DaSourcerer/jBBCode","description":"A lightweight but extensible BBCode parser written in PHP 5.3.","fork":true,"url":"https://api.github.com/repos/DaSourcerer/jBBCode","forks_url":"https://api.github.com/repos/DaSourcerer/jBBCode/forks","keys_url":"https://api.github.com/repos/DaSourcerer/jBBCode/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DaSourcerer/jBBCode/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DaSourcerer/jBBCode/teams","hooks_url":"https://api.github.com/repos/DaSourcerer/jBBCode/hooks","issue_events_url":"https://api.github.com/repos/DaSourcerer/jBBCode/issues/events{/number}","events_url":"https://api.github.com/repos/DaSourcerer/jBBCode/events","assignees_url":"https://api.github.com/repos/DaSourcerer/jBBCode/assignees{/user}","branches_url":"https://api.github.com/repos/DaSourcerer/jBBCode/branches{/branch}","tags_url":"https://api.github.com/repos/DaSourcerer/jBBCode/tags","blobs_url":"https://api.github.com/repos/DaSourcerer/jBBCode/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DaSourcerer/jBBCode/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DaSourcerer/jBBCode/git/refs{/sha}","trees_url":"https://api.github.com/repos/DaSourcerer/jBBCode/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DaSourcerer/jBBCode/statuses/{sha}","languages_url":"https://api.github.com/repos/DaSourcerer/jBBCode/languages","stargazers_url":"https://api.github.com/repos/DaSourcerer/jBBCode/stargazers","contributors_url":"https://api.github.com/repos/DaSourcerer/jBBCode/contributors","subscribers_url":"https://api.github.com/repos/DaSourcerer/jBBCode/subscribers","subscription_url":"https://api.github.com/repos/DaSourcerer/jBBCode/subscription","commits_url":"https://api.github.com/repos/DaSourcerer/jBBCode/commits{/sha}","git_commits_url":"https://api.github.com/repos/DaSourcerer/jBBCode/git/commits{/sha}","comments_url":"https://api.github.com/repos/DaSourcerer/jBBCode/comments{/number}","issue_comment_url":"https://api.github.com/repos/DaSourcerer/jBBCode/issues/comments{/number}","contents_url":"https://api.github.com/repos/DaSourcerer/jBBCode/contents/{+path}","compare_url":"https://api.github.com/repos/DaSourcerer/jBBCode/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DaSourcerer/jBBCode/merges","archive_url":"https://api.github.com/repos/DaSourcerer/jBBCode/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DaSourcerer/jBBCode/downloads","issues_url":"https://api.github.com/repos/DaSourcerer/jBBCode/issues{/number}","pulls_url":"https://api.github.com/repos/DaSourcerer/jBBCode/pulls{/number}","milestones_url":"https://api.github.com/repos/DaSourcerer/jBBCode/milestones{/number}","notifications_url":"https://api.github.com/repos/DaSourcerer/jBBCode/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DaSourcerer/jBBCode/labels{/name}","releases_url":"https://api.github.com/repos/DaSourcerer/jBBCode/releases{/id}","created_at":"2015-03-15T18:49:52Z","updated_at":"2015-03-21T09:06:04Z","pushed_at":"2015-03-21T15:55:45Z","git_url":"git://github.com/DaSourcerer/jBBCode.git","ssh_url":"git@github.com:DaSourcerer/jBBCode.git","clone_url":"https://github.com/DaSourcerer/jBBCode.git","svn_url":"https://github.com/DaSourcerer/jBBCode","homepage":"http://jbbcode.com","size":200,"stargazers_count":0,"watchers_count":0,"language":"PHP","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":"jbowens:master","ref":"master","sha":"f8dea1e06f385cb918a219c2f66b1baa94f6f191","user":{"login":"jbowens","id":867352,"avatar_url":"https://avatars.githubusercontent.com/u/867352?v=3","gravatar_id":"","url":"https://api.github.com/users/jbowens","html_url":"https://github.com/jbowens","followers_url":"https://api.github.com/users/jbowens/followers","following_url":"https://api.github.com/users/jbowens/following{/other_user}","gists_url":"https://api.github.com/users/jbowens/gists{/gist_id}","starred_url":"https://api.github.com/users/jbowens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbowens/subscriptions","organizations_url":"https://api.github.com/users/jbowens/orgs","repos_url":"https://api.github.com/users/jbowens/repos","events_url":"https://api.github.com/users/jbowens/events{/privacy}","received_events_url":"https://api.github.com/users/jbowens/received_events","type":"User","site_admin":false},"repo":{"id":4447681,"name":"jBBCode","full_name":"jbowens/jBBCode","owner":{"login":"jbowens","id":867352,"avatar_url":"https://avatars.githubusercontent.com/u/867352?v=3","gravatar_id":"","url":"https://api.github.com/users/jbowens","html_url":"https://github.com/jbowens","followers_url":"https://api.github.com/users/jbowens/followers","following_url":"https://api.github.com/users/jbowens/following{/other_user}","gists_url":"https://api.github.com/users/jbowens/gists{/gist_id}","starred_url":"https://api.github.com/users/jbowens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbowens/subscriptions","organizations_url":"https://api.github.com/users/jbowens/orgs","repos_url":"https://api.github.com/users/jbowens/repos","events_url":"https://api.github.com/users/jbowens/events{/privacy}","received_events_url":"https://api.github.com/users/jbowens/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jbowens/jBBCode","description":"A lightweight but extensible BBCode parser written in PHP 5.3.","fork":false,"url":"https://api.github.com/repos/jbowens/jBBCode","forks_url":"https://api.github.com/repos/jbowens/jBBCode/forks","keys_url":"https://api.github.com/repos/jbowens/jBBCode/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jbowens/jBBCode/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jbowens/jBBCode/teams","hooks_url":"https://api.github.com/repos/jbowens/jBBCode/hooks","issue_events_url":"https://api.github.com/repos/jbowens/jBBCode/issues/events{/number}","events_url":"https://api.github.com/repos/jbowens/jBBCode/events","assignees_url":"https://api.github.com/repos/jbowens/jBBCode/assignees{/user}","branches_url":"https://api.github.com/repos/jbowens/jBBCode/branches{/branch}","tags_url":"https://api.github.com/repos/jbowens/jBBCode/tags","blobs_url":"https://api.github.com/repos/jbowens/jBBCode/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jbowens/jBBCode/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jbowens/jBBCode/git/refs{/sha}","trees_url":"https://api.github.com/repos/jbowens/jBBCode/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jbowens/jBBCode/statuses/{sha}","languages_url":"https://api.github.com/repos/jbowens/jBBCode/languages","stargazers_url":"https://api.github.com/repos/jbowens/jBBCode/stargazers","contributors_url":"https://api.github.com/repos/jbowens/jBBCode/contributors","subscribers_url":"https://api.github.com/repos/jbowens/jBBCode/subscribers","subscription_url":"https://api.github.com/repos/jbowens/jBBCode/subscription","commits_url":"https://api.github.com/repos/jbowens/jBBCode/commits{/sha}","git_commits_url":"https://api.github.com/repos/jbowens/jBBCode/git/commits{/sha}","comments_url":"https://api.github.com/repos/jbowens/jBBCode/comments{/number}","issue_comment_url":"https://api.github.com/repos/jbowens/jBBCode/issues/comments{/number}","contents_url":"https://api.github.com/repos/jbowens/jBBCode/contents/{+path}","compare_url":"https://api.github.com/repos/jbowens/jBBCode/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jbowens/jBBCode/merges","archive_url":"https://api.github.com/repos/jbowens/jBBCode/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jbowens/jBBCode/downloads","issues_url":"https://api.github.com/repos/jbowens/jBBCode/issues{/number}","pulls_url":"https://api.github.com/repos/jbowens/jBBCode/pulls{/number}","milestones_url":"https://api.github.com/repos/jbowens/jBBCode/milestones{/number}","notifications_url":"https://api.github.com/repos/jbowens/jBBCode/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jbowens/jBBCode/labels{/name}","releases_url":"https://api.github.com/repos/jbowens/jBBCode/releases{/id}","created_at":"2012-05-25T16:42:25Z","updated_at":"2015-03-21T15:29:58Z","pushed_at":"2015-03-21T15:55:45Z","git_url":"git://github.com/jbowens/jBBCode.git","ssh_url":"git@github.com:jbowens/jBBCode.git","clone_url":"https://github.com/jbowens/jBBCode.git","svn_url":"https://github.com/jbowens/jBBCode","homepage":"http://jbbcode.com","size":637,"stargazers_count":87,"watchers_count":87,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":19,"mirror_url":null,"open_issues_count":13,"forks":19,"open_issues":13,"watchers":87,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jbowens/jBBCode/pulls/44"},"html":{"href":"https://github.com/jbowens/jBBCode/pull/44"},"issue":{"href":"https://api.github.com/repos/jbowens/jBBCode/issues/44"},"comments":{"href":"https://api.github.com/repos/jbowens/jBBCode/issues/44/comments"},"review_comments":{"href":"https://api.github.com/repos/jbowens/jBBCode/pulls/44/comments"},"review_comment":{"href":"https://api.github.com/repos/jbowens/jBBCode/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jbowens/jBBCode/pulls/44/commits"},"statuses":{"href":"https://api.github.com/repos/jbowens/jBBCode/statuses/765dca82d8f7b465c28b4c4085894041e02edeba"}}}}