{"action":"created","comment":{"url":"https://api.github.com/repos/yahoo/http-filters/pulls/comments/32147815","id":32147815,"diff_hunk":"@@ -128,6 +128,23 @@ struct LessThanAfter{\n   }\n };\n \n+struct StartsWith {\n+  const char * const p;\n+  const size_t s;\n+  const size_t o;\n+  StartsWith(const char * const p, const size_t s, const size_t o) :\n+    p(p), s(s), o(o) {\n+    ASSERT(p != NULL);\n+    ASSERT(s <= strlen(p));\n+  }\n+  template < class I >\n+  bool operator () (const I & i) const {\n+    const char * const begin = i->pointer,","path":"ts-impl.cc","position":15,"original_position":15,"commit_id":"1703d7e1f3591ad72ba89a1399613ca82924213b","original_commit_id":"1703d7e1f3591ad72ba89a1399613ca82924213b","user":{"login":"dmorilha","id":723098,"avatar_url":"https://avatars.githubusercontent.com/u/723098?v=3","gravatar_id":"","url":"https://api.github.com/users/dmorilha","html_url":"https://github.com/dmorilha","followers_url":"https://api.github.com/users/dmorilha/followers","following_url":"https://api.github.com/users/dmorilha/following{/other_user}","gists_url":"https://api.github.com/users/dmorilha/gists{/gist_id}","starred_url":"https://api.github.com/users/dmorilha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmorilha/subscriptions","organizations_url":"https://api.github.com/users/dmorilha/orgs","repos_url":"https://api.github.com/users/dmorilha/repos","events_url":"https://api.github.com/users/dmorilha/events{/privacy}","received_events_url":"https://api.github.com/users/dmorilha/received_events","type":"User","site_admin":false},"body":"We actually can't because we don't know the size of the input that we don't control (comes into the request). Example: we are looking starting on 2nd char on an empty string.","created_at":"2015-06-10T18:09:46Z","updated_at":"2015-06-10T18:09:46Z","html_url":"https://github.com/yahoo/http-filters/pull/5#discussion_r32147815","pull_request_url":"https://api.github.com/repos/yahoo/http-filters/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/yahoo/http-filters/pulls/comments/32147815"},"html":{"href":"https://github.com/yahoo/http-filters/pull/5#discussion_r32147815"},"pull_request":{"href":"https://api.github.com/repos/yahoo/http-filters/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/yahoo/http-filters/pulls/5","id":37309161,"html_url":"https://github.com/yahoo/http-filters/pull/5","diff_url":"https://github.com/yahoo/http-filters/pull/5.diff","patch_url":"https://github.com/yahoo/http-filters/pull/5.patch","issue_url":"https://api.github.com/repos/yahoo/http-filters/issues/5","number":5,"state":"open","locked":false,"title":"Adding starts with operation","user":{"login":"dmorilha","id":723098,"avatar_url":"https://avatars.githubusercontent.com/u/723098?v=3","gravatar_id":"","url":"https://api.github.com/users/dmorilha","html_url":"https://github.com/dmorilha","followers_url":"https://api.github.com/users/dmorilha/followers","following_url":"https://api.github.com/users/dmorilha/following{/other_user}","gists_url":"https://api.github.com/users/dmorilha/gists{/gist_id}","starred_url":"https://api.github.com/users/dmorilha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmorilha/subscriptions","organizations_url":"https://api.github.com/users/dmorilha/orgs","repos_url":"https://api.github.com/users/dmorilha/repos","events_url":"https://api.github.com/users/dmorilha/events{/privacy}","received_events_url":"https://api.github.com/users/dmorilha/received_events","type":"User","site_admin":false},"body":"@sc0ttbeardsley implementing StartsWith will give you a good idea on how to add a new operation...","created_at":"2015-06-09T22:55:33Z","updated_at":"2015-06-10T18:09:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9cb233ffd3fed984c4e09f1d153c10c12a4a25af","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/yahoo/http-filters/pulls/5/commits","review_comments_url":"https://api.github.com/repos/yahoo/http-filters/pulls/5/comments","review_comment_url":"https://api.github.com/repos/yahoo/http-filters/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yahoo/http-filters/issues/5/comments","statuses_url":"https://api.github.com/repos/yahoo/http-filters/statuses/1703d7e1f3591ad72ba89a1399613ca82924213b","head":{"label":"yahoo:adding-starts-with-operation","ref":"adding-starts-with-operation","sha":"1703d7e1f3591ad72ba89a1399613ca82924213b","user":{"login":"yahoo","id":16574,"avatar_url":"https://avatars.githubusercontent.com/u/16574?v=3","gravatar_id":"","url":"https://api.github.com/users/yahoo","html_url":"https://github.com/yahoo","followers_url":"https://api.github.com/users/yahoo/followers","following_url":"https://api.github.com/users/yahoo/following{/other_user}","gists_url":"https://api.github.com/users/yahoo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahoo/subscriptions","organizations_url":"https://api.github.com/users/yahoo/orgs","repos_url":"https://api.github.com/users/yahoo/repos","events_url":"https://api.github.com/users/yahoo/events{/privacy}","received_events_url":"https://api.github.com/users/yahoo/received_events","type":"Organization","site_admin":false},"repo":{"id":34066920,"name":"http-filters","full_name":"yahoo/http-filters","owner":{"login":"yahoo","id":16574,"avatar_url":"https://avatars.githubusercontent.com/u/16574?v=3","gravatar_id":"","url":"https://api.github.com/users/yahoo","html_url":"https://github.com/yahoo","followers_url":"https://api.github.com/users/yahoo/followers","following_url":"https://api.github.com/users/yahoo/following{/other_user}","gists_url":"https://api.github.com/users/yahoo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahoo/subscriptions","organizations_url":"https://api.github.com/users/yahoo/orgs","repos_url":"https://api.github.com/users/yahoo/repos","events_url":"https://api.github.com/users/yahoo/events{/privacy}","received_events_url":"https://api.github.com/users/yahoo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yahoo/http-filters","description":"Filters for HTTP requests","fork":false,"url":"https://api.github.com/repos/yahoo/http-filters","forks_url":"https://api.github.com/repos/yahoo/http-filters/forks","keys_url":"https://api.github.com/repos/yahoo/http-filters/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yahoo/http-filters/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yahoo/http-filters/teams","hooks_url":"https://api.github.com/repos/yahoo/http-filters/hooks","issue_events_url":"https://api.github.com/repos/yahoo/http-filters/issues/events{/number}","events_url":"https://api.github.com/repos/yahoo/http-filters/events","assignees_url":"https://api.github.com/repos/yahoo/http-filters/assignees{/user}","branches_url":"https://api.github.com/repos/yahoo/http-filters/branches{/branch}","tags_url":"https://api.github.com/repos/yahoo/http-filters/tags","blobs_url":"https://api.github.com/repos/yahoo/http-filters/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yahoo/http-filters/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yahoo/http-filters/git/refs{/sha}","trees_url":"https://api.github.com/repos/yahoo/http-filters/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yahoo/http-filters/statuses/{sha}","languages_url":"https://api.github.com/repos/yahoo/http-filters/languages","stargazers_url":"https://api.github.com/repos/yahoo/http-filters/stargazers","contributors_url":"https://api.github.com/repos/yahoo/http-filters/contributors","subscribers_url":"https://api.github.com/repos/yahoo/http-filters/subscribers","subscription_url":"https://api.github.com/repos/yahoo/http-filters/subscription","commits_url":"https://api.github.com/repos/yahoo/http-filters/commits{/sha}","git_commits_url":"https://api.github.com/repos/yahoo/http-filters/git/commits{/sha}","comments_url":"https://api.github.com/repos/yahoo/http-filters/comments{/number}","issue_comment_url":"https://api.github.com/repos/yahoo/http-filters/issues/comments{/number}","contents_url":"https://api.github.com/repos/yahoo/http-filters/contents/{+path}","compare_url":"https://api.github.com/repos/yahoo/http-filters/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yahoo/http-filters/merges","archive_url":"https://api.github.com/repos/yahoo/http-filters/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yahoo/http-filters/downloads","issues_url":"https://api.github.com/repos/yahoo/http-filters/issues{/number}","pulls_url":"https://api.github.com/repos/yahoo/http-filters/pulls{/number}","milestones_url":"https://api.github.com/repos/yahoo/http-filters/milestones{/number}","notifications_url":"https://api.github.com/repos/yahoo/http-filters/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yahoo/http-filters/labels{/name}","releases_url":"https://api.github.com/repos/yahoo/http-filters/releases{/id}","created_at":"2015-04-16T16:24:33Z","updated_at":"2015-04-29T15:00:38Z","pushed_at":"2015-06-09T22:55:33Z","git_url":"git://github.com/yahoo/http-filters.git","ssh_url":"git@github.com:yahoo/http-filters.git","clone_url":"https://github.com/yahoo/http-filters.git","svn_url":"https://github.com/yahoo/http-filters","homepage":"","size":236,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"yahoo:master","ref":"master","sha":"39cdcf893b9e2e2eeb939b3b90be9926faf5e434","user":{"login":"yahoo","id":16574,"avatar_url":"https://avatars.githubusercontent.com/u/16574?v=3","gravatar_id":"","url":"https://api.github.com/users/yahoo","html_url":"https://github.com/yahoo","followers_url":"https://api.github.com/users/yahoo/followers","following_url":"https://api.github.com/users/yahoo/following{/other_user}","gists_url":"https://api.github.com/users/yahoo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahoo/subscriptions","organizations_url":"https://api.github.com/users/yahoo/orgs","repos_url":"https://api.github.com/users/yahoo/repos","events_url":"https://api.github.com/users/yahoo/events{/privacy}","received_events_url":"https://api.github.com/users/yahoo/received_events","type":"Organization","site_admin":false},"repo":{"id":34066920,"name":"http-filters","full_name":"yahoo/http-filters","owner":{"login":"yahoo","id":16574,"avatar_url":"https://avatars.githubusercontent.com/u/16574?v=3","gravatar_id":"","url":"https://api.github.com/users/yahoo","html_url":"https://github.com/yahoo","followers_url":"https://api.github.com/users/yahoo/followers","following_url":"https://api.github.com/users/yahoo/following{/other_user}","gists_url":"https://api.github.com/users/yahoo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahoo/subscriptions","organizations_url":"https://api.github.com/users/yahoo/orgs","repos_url":"https://api.github.com/users/yahoo/repos","events_url":"https://api.github.com/users/yahoo/events{/privacy}","received_events_url":"https://api.github.com/users/yahoo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yahoo/http-filters","description":"Filters for HTTP requests","fork":false,"url":"https://api.github.com/repos/yahoo/http-filters","forks_url":"https://api.github.com/repos/yahoo/http-filters/forks","keys_url":"https://api.github.com/repos/yahoo/http-filters/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yahoo/http-filters/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yahoo/http-filters/teams","hooks_url":"https://api.github.com/repos/yahoo/http-filters/hooks","issue_events_url":"https://api.github.com/repos/yahoo/http-filters/issues/events{/number}","events_url":"https://api.github.com/repos/yahoo/http-filters/events","assignees_url":"https://api.github.com/repos/yahoo/http-filters/assignees{/user}","branches_url":"https://api.github.com/repos/yahoo/http-filters/branches{/branch}","tags_url":"https://api.github.com/repos/yahoo/http-filters/tags","blobs_url":"https://api.github.com/repos/yahoo/http-filters/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yahoo/http-filters/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yahoo/http-filters/git/refs{/sha}","trees_url":"https://api.github.com/repos/yahoo/http-filters/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yahoo/http-filters/statuses/{sha}","languages_url":"https://api.github.com/repos/yahoo/http-filters/languages","stargazers_url":"https://api.github.com/repos/yahoo/http-filters/stargazers","contributors_url":"https://api.github.com/repos/yahoo/http-filters/contributors","subscribers_url":"https://api.github.com/repos/yahoo/http-filters/subscribers","subscription_url":"https://api.github.com/repos/yahoo/http-filters/subscription","commits_url":"https://api.github.com/repos/yahoo/http-filters/commits{/sha}","git_commits_url":"https://api.github.com/repos/yahoo/http-filters/git/commits{/sha}","comments_url":"https://api.github.com/repos/yahoo/http-filters/comments{/number}","issue_comment_url":"https://api.github.com/repos/yahoo/http-filters/issues/comments{/number}","contents_url":"https://api.github.com/repos/yahoo/http-filters/contents/{+path}","compare_url":"https://api.github.com/repos/yahoo/http-filters/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yahoo/http-filters/merges","archive_url":"https://api.github.com/repos/yahoo/http-filters/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yahoo/http-filters/downloads","issues_url":"https://api.github.com/repos/yahoo/http-filters/issues{/number}","pulls_url":"https://api.github.com/repos/yahoo/http-filters/pulls{/number}","milestones_url":"https://api.github.com/repos/yahoo/http-filters/milestones{/number}","notifications_url":"https://api.github.com/repos/yahoo/http-filters/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yahoo/http-filters/labels{/name}","releases_url":"https://api.github.com/repos/yahoo/http-filters/releases{/id}","created_at":"2015-04-16T16:24:33Z","updated_at":"2015-04-29T15:00:38Z","pushed_at":"2015-06-09T22:55:33Z","git_url":"git://github.com/yahoo/http-filters.git","ssh_url":"git@github.com:yahoo/http-filters.git","clone_url":"https://github.com/yahoo/http-filters.git","svn_url":"https://github.com/yahoo/http-filters","homepage":"","size":236,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yahoo/http-filters/pulls/5"},"html":{"href":"https://github.com/yahoo/http-filters/pull/5"},"issue":{"href":"https://api.github.com/repos/yahoo/http-filters/issues/5"},"comments":{"href":"https://api.github.com/repos/yahoo/http-filters/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/yahoo/http-filters/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/yahoo/http-filters/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yahoo/http-filters/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/yahoo/http-filters/statuses/1703d7e1f3591ad72ba89a1399613ca82924213b"}}}}