{"action":"created","comment":{"url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/pulls/comments/25374481","id":25374481,"diff_hunk":"@@ -181,17 +181,38 @@ private void AddToListView(Paragraph p, string newText)\n \r\n         private bool IsFixAllowed(Paragraph p)\r\n         {\r\n-            foreach (ListViewItem item in listViewFixes.Items)\r\n+            var count = listViewFixes.Items.Count;\r\n+            int index = (count / 2) - 1;\r\n+            index = index >= 0 ? index : 0;\r\n+\r\n+            var pr = listViewFixes.Items[index].Tag as Paragraph;\r\n+            if (pr.ID == p.ID)\r\n+                return listViewFixes.Items[index].Checked;\r\n+\r\n+            if (pr.Number > p.Number)\r\n             {\r\n-                if (item.Tag.ToString() == p.ToString())\r\n-                    return item.Checked;\r\n+                for (int i = 0; i < index; i++)\r\n+                {\r\n+                    var pp = listViewFixes.Items[i].Tag as Paragraph;\r\n+                    if (pp.ID == p.ID)\r\n+                        return listViewFixes.Items[i].Checked;\r\n+                }\r\n+            }\r\n+            else\r\n+            {\r\n+                for (int i = index; i < count; i++)\r\n+                {\r\n+                    var pp = listViewFixes.Items[i].Tag as Paragraph;\r\n+                    if (pp.ID == p.ID)\r\n+                        return listViewFixes.Items[i].Checked;\r\n+                }\r\n             }\r\n             return false;\r\n         }\r\n \r\n         private void ButtonOkClick(object sender, EventArgs e)\r\n         {\r\n-            for (int i = _paragraphs.Count - 1; i > 0; i--)\r\n+            for (int i = 0; i < _paragraphs.Count; i++)\r","path":"src/Forms/AutoBreakUnbreakLines.cs","position":39,"original_position":39,"commit_id":"176699306373fbd9295c2603ad8df8cbac05356b","original_commit_id":"176699306373fbd9295c2603ad8df8cbac05356b","user":{"login":"ivandrofly","id":6579818,"avatar_url":"https://avatars.githubusercontent.com/u/6579818?v=3","gravatar_id":"","url":"https://api.github.com/users/ivandrofly","html_url":"https://github.com/ivandrofly","followers_url":"https://api.github.com/users/ivandrofly/followers","following_url":"https://api.github.com/users/ivandrofly/following{/other_user}","gists_url":"https://api.github.com/users/ivandrofly/gists{/gist_id}","starred_url":"https://api.github.com/users/ivandrofly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivandrofly/subscriptions","organizations_url":"https://api.github.com/users/ivandrofly/orgs","repos_url":"https://api.github.com/users/ivandrofly/repos","events_url":"https://api.github.com/users/ivandrofly/events{/privacy}","received_events_url":"https://api.github.com/users/ivandrofly/received_events","type":"User","site_admin":false},"body":"yeah, and it's still not safe:\r\n``` c#\r\n            var removeList = new List<string>();\r\n            for (int i = _paragraphs.Count - 1; i > 0; i--)\r\n            //for (int i = 0; i < _paragraphs.Count; i++)\r\n            {\r\n                Paragraph p = _paragraphs[i];\r\n                if (!IsFixAllowed(p))\r\n                {\r\n                    removeList.Add(p.ID);\r\n                }\r\n            }\r\n            _paragraphs.RemoveAll(x => removeList.Contains(x.ID));\r\n```","created_at":"2015-02-25T20:13:35Z","updated_at":"2015-02-25T20:13:35Z","html_url":"https://github.com/SubtitleEdit/subtitleedit/pull/573#discussion_r25374481","pull_request_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/pulls/573","_links":{"self":{"href":"https://api.github.com/repos/SubtitleEdit/subtitleedit/pulls/comments/25374481"},"html":{"href":"https://github.com/SubtitleEdit/subtitleedit/pull/573#discussion_r25374481"},"pull_request":{"href":"https://api.github.com/repos/SubtitleEdit/subtitleedit/pulls/573"}}},"pull_request":{"url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/pulls/573","id":29962358,"html_url":"https://github.com/SubtitleEdit/subtitleedit/pull/573","diff_url":"https://github.com/SubtitleEdit/subtitleedit/pull/573.diff","patch_url":"https://github.com/SubtitleEdit/subtitleedit/pull/573.patch","issue_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/issues/573","number":573,"state":"open","locked":false,"title":"AutoBreakUnbreakLines optimized 10x faster","user":{"login":"ivandrofly","id":6579818,"avatar_url":"https://avatars.githubusercontent.com/u/6579818?v=3","gravatar_id":"","url":"https://api.github.com/users/ivandrofly","html_url":"https://github.com/ivandrofly","followers_url":"https://api.github.com/users/ivandrofly/followers","following_url":"https://api.github.com/users/ivandrofly/following{/other_user}","gists_url":"https://api.github.com/users/ivandrofly/gists{/gist_id}","starred_url":"https://api.github.com/users/ivandrofly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivandrofly/subscriptions","organizations_url":"https://api.github.com/users/ivandrofly/orgs","repos_url":"https://api.github.com/users/ivandrofly/repos","events_url":"https://api.github.com/users/ivandrofly/events{/privacy}","received_events_url":"https://api.github.com/users/ivandrofly/received_events","type":"User","site_admin":false},"body":"10x faster ;) /cc @niksedk, @xylographe","created_at":"2015-02-25T05:36:22Z","updated_at":"2015-02-25T20:13:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e0e60c9324cd18d3f03194c08d0c031b6d0e7481","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/pulls/573/commits","review_comments_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/pulls/573/comments","review_comment_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/issues/573/comments","statuses_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/statuses/176699306373fbd9295c2603ad8df8cbac05356b","head":{"label":"ivandrofly:optmization/patch-1","ref":"optmization/patch-1","sha":"176699306373fbd9295c2603ad8df8cbac05356b","user":{"login":"ivandrofly","id":6579818,"avatar_url":"https://avatars.githubusercontent.com/u/6579818?v=3","gravatar_id":"","url":"https://api.github.com/users/ivandrofly","html_url":"https://github.com/ivandrofly","followers_url":"https://api.github.com/users/ivandrofly/followers","following_url":"https://api.github.com/users/ivandrofly/following{/other_user}","gists_url":"https://api.github.com/users/ivandrofly/gists{/gist_id}","starred_url":"https://api.github.com/users/ivandrofly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivandrofly/subscriptions","organizations_url":"https://api.github.com/users/ivandrofly/orgs","repos_url":"https://api.github.com/users/ivandrofly/repos","events_url":"https://api.github.com/users/ivandrofly/events{/privacy}","received_events_url":"https://api.github.com/users/ivandrofly/received_events","type":"User","site_admin":false},"repo":{"id":20601147,"name":"subtitleedit","full_name":"ivandrofly/subtitleedit","owner":{"login":"ivandrofly","id":6579818,"avatar_url":"https://avatars.githubusercontent.com/u/6579818?v=3","gravatar_id":"","url":"https://api.github.com/users/ivandrofly","html_url":"https://github.com/ivandrofly","followers_url":"https://api.github.com/users/ivandrofly/followers","following_url":"https://api.github.com/users/ivandrofly/following{/other_user}","gists_url":"https://api.github.com/users/ivandrofly/gists{/gist_id}","starred_url":"https://api.github.com/users/ivandrofly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivandrofly/subscriptions","organizations_url":"https://api.github.com/users/ivandrofly/orgs","repos_url":"https://api.github.com/users/ivandrofly/repos","events_url":"https://api.github.com/users/ivandrofly/events{/privacy}","received_events_url":"https://api.github.com/users/ivandrofly/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ivandrofly/subtitleedit","description":"the subtitle editor :)","fork":true,"url":"https://api.github.com/repos/ivandrofly/subtitleedit","forks_url":"https://api.github.com/repos/ivandrofly/subtitleedit/forks","keys_url":"https://api.github.com/repos/ivandrofly/subtitleedit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ivandrofly/subtitleedit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ivandrofly/subtitleedit/teams","hooks_url":"https://api.github.com/repos/ivandrofly/subtitleedit/hooks","issue_events_url":"https://api.github.com/repos/ivandrofly/subtitleedit/issues/events{/number}","events_url":"https://api.github.com/repos/ivandrofly/subtitleedit/events","assignees_url":"https://api.github.com/repos/ivandrofly/subtitleedit/assignees{/user}","branches_url":"https://api.github.com/repos/ivandrofly/subtitleedit/branches{/branch}","tags_url":"https://api.github.com/repos/ivandrofly/subtitleedit/tags","blobs_url":"https://api.github.com/repos/ivandrofly/subtitleedit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ivandrofly/subtitleedit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ivandrofly/subtitleedit/git/refs{/sha}","trees_url":"https://api.github.com/repos/ivandrofly/subtitleedit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ivandrofly/subtitleedit/statuses/{sha}","languages_url":"https://api.github.com/repos/ivandrofly/subtitleedit/languages","stargazers_url":"https://api.github.com/repos/ivandrofly/subtitleedit/stargazers","contributors_url":"https://api.github.com/repos/ivandrofly/subtitleedit/contributors","subscribers_url":"https://api.github.com/repos/ivandrofly/subtitleedit/subscribers","subscription_url":"https://api.github.com/repos/ivandrofly/subtitleedit/subscription","commits_url":"https://api.github.com/repos/ivandrofly/subtitleedit/commits{/sha}","git_commits_url":"https://api.github.com/repos/ivandrofly/subtitleedit/git/commits{/sha}","comments_url":"https://api.github.com/repos/ivandrofly/subtitleedit/comments{/number}","issue_comment_url":"https://api.github.com/repos/ivandrofly/subtitleedit/issues/comments{/number}","contents_url":"https://api.github.com/repos/ivandrofly/subtitleedit/contents/{+path}","compare_url":"https://api.github.com/repos/ivandrofly/subtitleedit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ivandrofly/subtitleedit/merges","archive_url":"https://api.github.com/repos/ivandrofly/subtitleedit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ivandrofly/subtitleedit/downloads","issues_url":"https://api.github.com/repos/ivandrofly/subtitleedit/issues{/number}","pulls_url":"https://api.github.com/repos/ivandrofly/subtitleedit/pulls{/number}","milestones_url":"https://api.github.com/repos/ivandrofly/subtitleedit/milestones{/number}","notifications_url":"https://api.github.com/repos/ivandrofly/subtitleedit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ivandrofly/subtitleedit/labels{/name}","releases_url":"https://api.github.com/repos/ivandrofly/subtitleedit/releases{/id}","created_at":"2014-06-07T19:35:40Z","updated_at":"2015-02-25T05:40:11Z","pushed_at":"2015-02-25T05:40:07Z","git_url":"git://github.com/ivandrofly/subtitleedit.git","ssh_url":"git@github.com:ivandrofly/subtitleedit.git","clone_url":"https://github.com/ivandrofly/subtitleedit.git","svn_url":"https://github.com/ivandrofly/subtitleedit","homepage":"http://www.nikse.dk/SubtitleEdit/","size":52154,"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":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"SubtitleEdit:master","ref":"master","sha":"439e33c6f95b635ba8ea2a43a3d82fe12963d17d","user":{"login":"SubtitleEdit","id":3008853,"avatar_url":"https://avatars.githubusercontent.com/u/3008853?v=3","gravatar_id":"","url":"https://api.github.com/users/SubtitleEdit","html_url":"https://github.com/SubtitleEdit","followers_url":"https://api.github.com/users/SubtitleEdit/followers","following_url":"https://api.github.com/users/SubtitleEdit/following{/other_user}","gists_url":"https://api.github.com/users/SubtitleEdit/gists{/gist_id}","starred_url":"https://api.github.com/users/SubtitleEdit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SubtitleEdit/subscriptions","organizations_url":"https://api.github.com/users/SubtitleEdit/orgs","repos_url":"https://api.github.com/users/SubtitleEdit/repos","events_url":"https://api.github.com/users/SubtitleEdit/events{/privacy}","received_events_url":"https://api.github.com/users/SubtitleEdit/received_events","type":"Organization","site_admin":false},"repo":{"id":16473585,"name":"subtitleedit","full_name":"SubtitleEdit/subtitleedit","owner":{"login":"SubtitleEdit","id":3008853,"avatar_url":"https://avatars.githubusercontent.com/u/3008853?v=3","gravatar_id":"","url":"https://api.github.com/users/SubtitleEdit","html_url":"https://github.com/SubtitleEdit","followers_url":"https://api.github.com/users/SubtitleEdit/followers","following_url":"https://api.github.com/users/SubtitleEdit/following{/other_user}","gists_url":"https://api.github.com/users/SubtitleEdit/gists{/gist_id}","starred_url":"https://api.github.com/users/SubtitleEdit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SubtitleEdit/subscriptions","organizations_url":"https://api.github.com/users/SubtitleEdit/orgs","repos_url":"https://api.github.com/users/SubtitleEdit/repos","events_url":"https://api.github.com/users/SubtitleEdit/events{/privacy}","received_events_url":"https://api.github.com/users/SubtitleEdit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SubtitleEdit/subtitleedit","description":"the subtitle editor :)","fork":false,"url":"https://api.github.com/repos/SubtitleEdit/subtitleedit","forks_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/forks","keys_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/teams","hooks_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/hooks","issue_events_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/issues/events{/number}","events_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/events","assignees_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/assignees{/user}","branches_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/branches{/branch}","tags_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/tags","blobs_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/git/refs{/sha}","trees_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/statuses/{sha}","languages_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/languages","stargazers_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/stargazers","contributors_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/contributors","subscribers_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/subscribers","subscription_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/subscription","commits_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/commits{/sha}","git_commits_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/git/commits{/sha}","comments_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/comments{/number}","issue_comment_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/issues/comments{/number}","contents_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/contents/{+path}","compare_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/merges","archive_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/downloads","issues_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/issues{/number}","pulls_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/pulls{/number}","milestones_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/milestones{/number}","notifications_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/labels{/name}","releases_url":"https://api.github.com/repos/SubtitleEdit/subtitleedit/releases{/id}","created_at":"2014-02-03T08:17:41Z","updated_at":"2015-02-25T14:29:46Z","pushed_at":"2015-02-25T14:29:46Z","git_url":"git://github.com/SubtitleEdit/subtitleedit.git","ssh_url":"git@github.com:SubtitleEdit/subtitleedit.git","clone_url":"https://github.com/SubtitleEdit/subtitleedit.git","svn_url":"https://github.com/SubtitleEdit/subtitleedit","homepage":"http://www.nikse.dk/SubtitleEdit/","size":60084,"stargazers_count":179,"watchers_count":179,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":59,"mirror_url":null,"open_issues_count":88,"forks":59,"open_issues":88,"watchers":179,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SubtitleEdit/subtitleedit/pulls/573"},"html":{"href":"https://github.com/SubtitleEdit/subtitleedit/pull/573"},"issue":{"href":"https://api.github.com/repos/SubtitleEdit/subtitleedit/issues/573"},"comments":{"href":"https://api.github.com/repos/SubtitleEdit/subtitleedit/issues/573/comments"},"review_comments":{"href":"https://api.github.com/repos/SubtitleEdit/subtitleedit/pulls/573/comments"},"review_comment":{"href":"https://api.github.com/repos/SubtitleEdit/subtitleedit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SubtitleEdit/subtitleedit/pulls/573/commits"},"statuses":{"href":"https://api.github.com/repos/SubtitleEdit/subtitleedit/statuses/176699306373fbd9295c2603ad8df8cbac05356b"}}}}