{"action":"created","comment":{"url":"https://api.github.com/repos/rainmagnius/clean-code/pulls/comments/88806682","pull_request_review_id":9369013,"id":88806682,"diff_hunk":"@@ -0,0 +1,134 @@\n+﻿using System.Collections.Generic;\n+using System.Linq;\n+\n+namespace Markdown.Tags\n+{\n+    public static class TagsUtil\n+    {\n+        public static ITag ReadTag(int index, string markdown, Dictionary<string, ITag> tags)\n+        {\n+            var tagName = \"\";\n+            var findedTags = new List<ITag>();\n+            var currentIndex = index;\n+            while (currentIndex < markdown.Length)\n+            {\n+                ITag nextTag;\n+                tagName += markdown[currentIndex];\n+                if (tags.TryGetValue(tagName, out nextTag))\n+                {\n+                    findedTags.Add(nextTag);\n+                    currentIndex++;\n+                }\n+                else\n+                {\n+                    break;\n+                }\n+            }\n+            var maxPriority = findedTags.Max(t => t.Priority);\n+            return findedTags.FirstOrDefault(t => t.Priority == maxPriority);\n+        }\n+\n+        public static bool TryReadTag(int index, string markdown, Dictionary<string, ITag> tags)\n+        {\n+            if (index >= markdown.Length)\n+            {\n+                return false;\n+            }\n+            return tags.ContainsKey(markdown[index].ToString());\n+        }\n+\n+        public static bool TryReadTag(int index, string markdown, out ITag tag, Dictionary<string, ITag> tags)","path":"Markdown/Tags/TagsUtil.cs","position":40,"original_position":40,"commit_id":"c3e10ba8ec111b5e34fab2db81e6caa4382ad54b","original_commit_id":"c3e10ba8ec111b5e34fab2db81e6caa4382ad54b","user":{"login":"mironov-alexey","id":6783167,"avatar_url":"https://avatars.githubusercontent.com/u/6783167?v=3","gravatar_id":"","url":"https://api.github.com/users/mironov-alexey","html_url":"https://github.com/mironov-alexey","followers_url":"https://api.github.com/users/mironov-alexey/followers","following_url":"https://api.github.com/users/mironov-alexey/following{/other_user}","gists_url":"https://api.github.com/users/mironov-alexey/gists{/gist_id}","starred_url":"https://api.github.com/users/mironov-alexey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mironov-alexey/subscriptions","organizations_url":"https://api.github.com/users/mironov-alexey/orgs","repos_url":"https://api.github.com/users/mironov-alexey/repos","events_url":"https://api.github.com/users/mironov-alexey/events{/privacy}","received_events_url":"https://api.github.com/users/mironov-alexey/received_events","type":"User","site_admin":false},"body":"кажется, в этом методе очень много дублирования кода `ReadTag`","created_at":"2016-11-20T17:31:48Z","updated_at":"2016-11-20T17:31:48Z","html_url":"https://github.com/rainmagnius/clean-code/pull/1#discussion_r88806682","pull_request_url":"https://api.github.com/repos/rainmagnius/clean-code/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/rainmagnius/clean-code/pulls/comments/88806682"},"html":{"href":"https://github.com/rainmagnius/clean-code/pull/1#discussion_r88806682"},"pull_request":{"href":"https://api.github.com/repos/rainmagnius/clean-code/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/rainmagnius/clean-code/pulls/1","id":94012548,"html_url":"https://github.com/rainmagnius/clean-code/pull/1","diff_url":"https://github.com/rainmagnius/clean-code/pull/1.diff","patch_url":"https://github.com/rainmagnius/clean-code/pull/1.patch","issue_url":"https://api.github.com/repos/rainmagnius/clean-code/issues/1","number":1,"state":"open","locked":false,"title":"For homework","user":{"login":"rainmagnius","id":20732767,"avatar_url":"https://avatars.githubusercontent.com/u/20732767?v=3","gravatar_id":"","url":"https://api.github.com/users/rainmagnius","html_url":"https://github.com/rainmagnius","followers_url":"https://api.github.com/users/rainmagnius/followers","following_url":"https://api.github.com/users/rainmagnius/following{/other_user}","gists_url":"https://api.github.com/users/rainmagnius/gists{/gist_id}","starred_url":"https://api.github.com/users/rainmagnius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rainmagnius/subscriptions","organizations_url":"https://api.github.com/users/rainmagnius/orgs","repos_url":"https://api.github.com/users/rainmagnius/repos","events_url":"https://api.github.com/users/rainmagnius/events{/privacy}","received_events_url":"https://api.github.com/users/rainmagnius/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-11-16T17:29:34Z","updated_at":"2016-11-20T17:31:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1250eaa37331a38b2592ccd466f63d1ced1cc23f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/rainmagnius/clean-code/pulls/1/commits","review_comments_url":"https://api.github.com/repos/rainmagnius/clean-code/pulls/1/comments","review_comment_url":"https://api.github.com/repos/rainmagnius/clean-code/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rainmagnius/clean-code/issues/1/comments","statuses_url":"https://api.github.com/repos/rainmagnius/clean-code/statuses/c3e10ba8ec111b5e34fab2db81e6caa4382ad54b","head":{"label":"rainmagnius:master","ref":"master","sha":"c3e10ba8ec111b5e34fab2db81e6caa4382ad54b","user":{"login":"rainmagnius","id":20732767,"avatar_url":"https://avatars.githubusercontent.com/u/20732767?v=3","gravatar_id":"","url":"https://api.github.com/users/rainmagnius","html_url":"https://github.com/rainmagnius","followers_url":"https://api.github.com/users/rainmagnius/followers","following_url":"https://api.github.com/users/rainmagnius/following{/other_user}","gists_url":"https://api.github.com/users/rainmagnius/gists{/gist_id}","starred_url":"https://api.github.com/users/rainmagnius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rainmagnius/subscriptions","organizations_url":"https://api.github.com/users/rainmagnius/orgs","repos_url":"https://api.github.com/users/rainmagnius/repos","events_url":"https://api.github.com/users/rainmagnius/events{/privacy}","received_events_url":"https://api.github.com/users/rainmagnius/received_events","type":"User","site_admin":false},"repo":{"id":72929382,"name":"clean-code","full_name":"rainmagnius/clean-code","owner":{"login":"rainmagnius","id":20732767,"avatar_url":"https://avatars.githubusercontent.com/u/20732767?v=3","gravatar_id":"","url":"https://api.github.com/users/rainmagnius","html_url":"https://github.com/rainmagnius","followers_url":"https://api.github.com/users/rainmagnius/followers","following_url":"https://api.github.com/users/rainmagnius/following{/other_user}","gists_url":"https://api.github.com/users/rainmagnius/gists{/gist_id}","starred_url":"https://api.github.com/users/rainmagnius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rainmagnius/subscriptions","organizations_url":"https://api.github.com/users/rainmagnius/orgs","repos_url":"https://api.github.com/users/rainmagnius/repos","events_url":"https://api.github.com/users/rainmagnius/events{/privacy}","received_events_url":"https://api.github.com/users/rainmagnius/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rainmagnius/clean-code","description":"Clean code","fork":true,"url":"https://api.github.com/repos/rainmagnius/clean-code","forks_url":"https://api.github.com/repos/rainmagnius/clean-code/forks","keys_url":"https://api.github.com/repos/rainmagnius/clean-code/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rainmagnius/clean-code/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rainmagnius/clean-code/teams","hooks_url":"https://api.github.com/repos/rainmagnius/clean-code/hooks","issue_events_url":"https://api.github.com/repos/rainmagnius/clean-code/issues/events{/number}","events_url":"https://api.github.com/repos/rainmagnius/clean-code/events","assignees_url":"https://api.github.com/repos/rainmagnius/clean-code/assignees{/user}","branches_url":"https://api.github.com/repos/rainmagnius/clean-code/branches{/branch}","tags_url":"https://api.github.com/repos/rainmagnius/clean-code/tags","blobs_url":"https://api.github.com/repos/rainmagnius/clean-code/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rainmagnius/clean-code/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rainmagnius/clean-code/git/refs{/sha}","trees_url":"https://api.github.com/repos/rainmagnius/clean-code/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rainmagnius/clean-code/statuses/{sha}","languages_url":"https://api.github.com/repos/rainmagnius/clean-code/languages","stargazers_url":"https://api.github.com/repos/rainmagnius/clean-code/stargazers","contributors_url":"https://api.github.com/repos/rainmagnius/clean-code/contributors","subscribers_url":"https://api.github.com/repos/rainmagnius/clean-code/subscribers","subscription_url":"https://api.github.com/repos/rainmagnius/clean-code/subscription","commits_url":"https://api.github.com/repos/rainmagnius/clean-code/commits{/sha}","git_commits_url":"https://api.github.com/repos/rainmagnius/clean-code/git/commits{/sha}","comments_url":"https://api.github.com/repos/rainmagnius/clean-code/comments{/number}","issue_comment_url":"https://api.github.com/repos/rainmagnius/clean-code/issues/comments{/number}","contents_url":"https://api.github.com/repos/rainmagnius/clean-code/contents/{+path}","compare_url":"https://api.github.com/repos/rainmagnius/clean-code/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rainmagnius/clean-code/merges","archive_url":"https://api.github.com/repos/rainmagnius/clean-code/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rainmagnius/clean-code/downloads","issues_url":"https://api.github.com/repos/rainmagnius/clean-code/issues{/number}","pulls_url":"https://api.github.com/repos/rainmagnius/clean-code/pulls{/number}","milestones_url":"https://api.github.com/repos/rainmagnius/clean-code/milestones{/number}","notifications_url":"https://api.github.com/repos/rainmagnius/clean-code/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rainmagnius/clean-code/labels{/name}","releases_url":"https://api.github.com/repos/rainmagnius/clean-code/releases{/id}","deployments_url":"https://api.github.com/repos/rainmagnius/clean-code/deployments","created_at":"2016-11-05T13:57:35Z","updated_at":"2016-11-05T13:57:37Z","pushed_at":"2016-11-20T12:53:33Z","git_url":"git://github.com/rainmagnius/clean-code.git","ssh_url":"git@github.com:rainmagnius/clean-code.git","clone_url":"https://github.com/rainmagnius/clean-code.git","svn_url":"https://github.com/rainmagnius/clean-code","homepage":null,"size":11814,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"rainmagnius:Homework","ref":"Homework","sha":"389adf2d02ffe5de1df871163b76074e25230603","user":{"login":"rainmagnius","id":20732767,"avatar_url":"https://avatars.githubusercontent.com/u/20732767?v=3","gravatar_id":"","url":"https://api.github.com/users/rainmagnius","html_url":"https://github.com/rainmagnius","followers_url":"https://api.github.com/users/rainmagnius/followers","following_url":"https://api.github.com/users/rainmagnius/following{/other_user}","gists_url":"https://api.github.com/users/rainmagnius/gists{/gist_id}","starred_url":"https://api.github.com/users/rainmagnius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rainmagnius/subscriptions","organizations_url":"https://api.github.com/users/rainmagnius/orgs","repos_url":"https://api.github.com/users/rainmagnius/repos","events_url":"https://api.github.com/users/rainmagnius/events{/privacy}","received_events_url":"https://api.github.com/users/rainmagnius/received_events","type":"User","site_admin":false},"repo":{"id":72929382,"name":"clean-code","full_name":"rainmagnius/clean-code","owner":{"login":"rainmagnius","id":20732767,"avatar_url":"https://avatars.githubusercontent.com/u/20732767?v=3","gravatar_id":"","url":"https://api.github.com/users/rainmagnius","html_url":"https://github.com/rainmagnius","followers_url":"https://api.github.com/users/rainmagnius/followers","following_url":"https://api.github.com/users/rainmagnius/following{/other_user}","gists_url":"https://api.github.com/users/rainmagnius/gists{/gist_id}","starred_url":"https://api.github.com/users/rainmagnius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rainmagnius/subscriptions","organizations_url":"https://api.github.com/users/rainmagnius/orgs","repos_url":"https://api.github.com/users/rainmagnius/repos","events_url":"https://api.github.com/users/rainmagnius/events{/privacy}","received_events_url":"https://api.github.com/users/rainmagnius/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rainmagnius/clean-code","description":"Clean code","fork":true,"url":"https://api.github.com/repos/rainmagnius/clean-code","forks_url":"https://api.github.com/repos/rainmagnius/clean-code/forks","keys_url":"https://api.github.com/repos/rainmagnius/clean-code/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rainmagnius/clean-code/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rainmagnius/clean-code/teams","hooks_url":"https://api.github.com/repos/rainmagnius/clean-code/hooks","issue_events_url":"https://api.github.com/repos/rainmagnius/clean-code/issues/events{/number}","events_url":"https://api.github.com/repos/rainmagnius/clean-code/events","assignees_url":"https://api.github.com/repos/rainmagnius/clean-code/assignees{/user}","branches_url":"https://api.github.com/repos/rainmagnius/clean-code/branches{/branch}","tags_url":"https://api.github.com/repos/rainmagnius/clean-code/tags","blobs_url":"https://api.github.com/repos/rainmagnius/clean-code/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rainmagnius/clean-code/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rainmagnius/clean-code/git/refs{/sha}","trees_url":"https://api.github.com/repos/rainmagnius/clean-code/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rainmagnius/clean-code/statuses/{sha}","languages_url":"https://api.github.com/repos/rainmagnius/clean-code/languages","stargazers_url":"https://api.github.com/repos/rainmagnius/clean-code/stargazers","contributors_url":"https://api.github.com/repos/rainmagnius/clean-code/contributors","subscribers_url":"https://api.github.com/repos/rainmagnius/clean-code/subscribers","subscription_url":"https://api.github.com/repos/rainmagnius/clean-code/subscription","commits_url":"https://api.github.com/repos/rainmagnius/clean-code/commits{/sha}","git_commits_url":"https://api.github.com/repos/rainmagnius/clean-code/git/commits{/sha}","comments_url":"https://api.github.com/repos/rainmagnius/clean-code/comments{/number}","issue_comment_url":"https://api.github.com/repos/rainmagnius/clean-code/issues/comments{/number}","contents_url":"https://api.github.com/repos/rainmagnius/clean-code/contents/{+path}","compare_url":"https://api.github.com/repos/rainmagnius/clean-code/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rainmagnius/clean-code/merges","archive_url":"https://api.github.com/repos/rainmagnius/clean-code/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rainmagnius/clean-code/downloads","issues_url":"https://api.github.com/repos/rainmagnius/clean-code/issues{/number}","pulls_url":"https://api.github.com/repos/rainmagnius/clean-code/pulls{/number}","milestones_url":"https://api.github.com/repos/rainmagnius/clean-code/milestones{/number}","notifications_url":"https://api.github.com/repos/rainmagnius/clean-code/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rainmagnius/clean-code/labels{/name}","releases_url":"https://api.github.com/repos/rainmagnius/clean-code/releases{/id}","deployments_url":"https://api.github.com/repos/rainmagnius/clean-code/deployments","created_at":"2016-11-05T13:57:35Z","updated_at":"2016-11-05T13:57:37Z","pushed_at":"2016-11-20T12:53:33Z","git_url":"git://github.com/rainmagnius/clean-code.git","ssh_url":"git@github.com:rainmagnius/clean-code.git","clone_url":"https://github.com/rainmagnius/clean-code.git","svn_url":"https://github.com/rainmagnius/clean-code","homepage":null,"size":11814,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rainmagnius/clean-code/pulls/1"},"html":{"href":"https://github.com/rainmagnius/clean-code/pull/1"},"issue":{"href":"https://api.github.com/repos/rainmagnius/clean-code/issues/1"},"comments":{"href":"https://api.github.com/repos/rainmagnius/clean-code/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/rainmagnius/clean-code/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/rainmagnius/clean-code/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rainmagnius/clean-code/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/rainmagnius/clean-code/statuses/c3e10ba8ec111b5e34fab2db81e6caa4382ad54b"}}}}
{"actor":{"display_login":"mironov-alexey"}}