{"action":"created","comment":{"url":"https://api.github.com/repos/seqan/seqan/pulls/comments/52310268","id":52310268,"diff_hunk":"@@ -579,10 +583,74 @@ resize(\n         clear(host(me));\n         return 0;\n     }\n-    TStringSize max_length = (resize(host(me), TTraits::toHostLength(new_length) + 1, tag) - 1) * TTraits::VALUES_PER_HOST_VALUE;\n-    if ((TStringSize)new_length > max_length)\n-        new_length = max_length;\n-    return front(host(me)).i = new_length;\n+\n+    TStringSize _new_length = new_length;\n+    TStringSize max_length = (resize(host(me), TTraits::toHostLength(_new_length) + 1, tag) - 1) * TTraits::VALUES_PER_HOST_VALUE;\n+    if (_new_length > max_length)\n+        _new_length = max_length;\n+    front(host(me)).i = _new_length;\n+\n+    return _new_length;\n+}\n+\n+template <typename TValue, typename THostspec, typename TSize, typename TExpand, typename TValue2>\n+inline typename Size< String<TValue, Packed<THostspec> > >::Type\n+resize(String<TValue, Packed<THostspec> > & me,\n+       TSize new_length,\n+       TValue2 const & newValue,\n+       Tag<TExpand> tag)\n+{\n+    typedef String<TValue, Packed<THostspec> > TString;\n+    typedef PackedTraits_<TString> TTraits;\n+    typedef typename Size<TString>::Type TStringSize;\n+\n+    TStringSize _new_length = new_length;\n+    TStringSize old_length = length(me);\n+\n+    if (_new_length < length(me))\n+        return resize(me, _new_length, tag);\n+\n+    // create WORD\n+    String<TValue, Packed<THostspec> > tmp;\n+    resize(tmp, static_cast<unsigned>(TTraits::VALUES_PER_HOST_VALUE), Exact());\n+    for (unsigned i = 0; i < TTraits::VALUES_PER_HOST_VALUE; ++i)\n+        tmp[i] = newValue;\n+\n+    // fill up host string word-wise\n+    TStringSize max_length = (resize(host(me),\n+                                     TTraits::toHostLength(_new_length) + 1,\n+                                     getValue(host(tmp), 1),\n+                                     tag) - 1)\n+                             * TTraits::VALUES_PER_HOST_VALUE;\n+\n+    // set values on formerly last word, because not affected by above\n+    TStringSize trailing_values = TTraits::VALUES_PER_HOST_VALUE - (old_length % TTraits::VALUES_PER_HOST_VALUE);\n+    for (TStringSize i = 0; i < trailing_values; ++i)\n+        me[old_length + i] = newValue;\n+\n+    if (_new_length > max_length)","path":"include/seqan/sequence/string_packed.h","position":64,"original_position":64,"commit_id":"1ce36bba6afaebe0e0fcd42668d242183055ecd9","original_commit_id":"1ce36bba6afaebe0e0fcd42668d242183055ecd9","user":{"login":"h-2","id":2996863,"avatar_url":"https://avatars.githubusercontent.com/u/2996863?v=3","gravatar_id":"","url":"https://api.github.com/users/h-2","html_url":"https://github.com/h-2","followers_url":"https://api.github.com/users/h-2/followers","following_url":"https://api.github.com/users/h-2/following{/other_user}","gists_url":"https://api.github.com/users/h-2/gists{/gist_id}","starred_url":"https://api.github.com/users/h-2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h-2/subscriptions","organizations_url":"https://api.github.com/users/h-2/orgs","repos_url":"https://api.github.com/users/h-2/repos","events_url":"https://api.github.com/users/h-2/events{/privacy}","received_events_url":"https://api.github.com/users/h-2/received_events","type":"User","site_admin":false},"body":"again: see above :)","created_at":"2016-02-09T14:03:05Z","updated_at":"2016-02-09T14:03:05Z","html_url":"https://github.com/seqan/seqan/pull/1429#discussion_r52310268","pull_request_url":"https://api.github.com/repos/seqan/seqan/pulls/1429","_links":{"self":{"href":"https://api.github.com/repos/seqan/seqan/pulls/comments/52310268"},"html":{"href":"https://github.com/seqan/seqan/pull/1429#discussion_r52310268"},"pull_request":{"href":"https://api.github.com/repos/seqan/seqan/pulls/1429"}}},"pull_request":{"url":"https://api.github.com/repos/seqan/seqan/pulls/1429","id":58451526,"html_url":"https://github.com/seqan/seqan/pull/1429","diff_url":"https://github.com/seqan/seqan/pull/1429.diff","patch_url":"https://github.com/seqan/seqan/pull/1429.patch","issue_url":"https://api.github.com/repos/seqan/seqan/issues/1429","number":1429,"state":"open","locked":false,"title":"[WORKAROUND] fix insert() in packed_string","user":{"login":"h-2","id":2996863,"avatar_url":"https://avatars.githubusercontent.com/u/2996863?v=3","gravatar_id":"","url":"https://api.github.com/users/h-2","html_url":"https://github.com/h-2","followers_url":"https://api.github.com/users/h-2/followers","following_url":"https://api.github.com/users/h-2/following{/other_user}","gists_url":"https://api.github.com/users/h-2/gists{/gist_id}","starred_url":"https://api.github.com/users/h-2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h-2/subscriptions","organizations_url":"https://api.github.com/users/h-2/orgs","repos_url":"https://api.github.com/users/h-2/repos","events_url":"https://api.github.com/users/h-2/events{/privacy}","received_events_url":"https://api.github.com/users/h-2/received_events","type":"User","site_admin":false},"body":"  * resize() without value is unchanged\r\n  * more efficient host-based resize() with value added\r\n  * insert() changed to where clearUnusedBits() is called before the real insert to fix the bugs we where seeing with #1074 \r\n\r\nThere is probably a larger problem hidden within ClearSpaceStringPacked_ or even the memcpy functions, but the problem only appeared with inserts and they have a workaround now, so everything is usable and regular resizes are not affected (initializing resizes should even be faster now).\r\n\r\nPLEASE NOTE that some valgrind warnings for unintialized reads are unrelated to this and simply part of the implementation, i.e. seqan resizes() dont initialize and if only the first n bits are read and written, this implicitly read/writes the other bits although there value is irrelevant to the implementation.  This could be worked around (to silence the warnings) but this can be done for one of the next releases.","created_at":"2016-02-05T16:32:46Z","updated_at":"2016-02-09T14:03:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f2f13f94dd6134533d9caf72d7ce3ca6b4121204","assignee":{"login":"rrahn","id":1529364,"avatar_url":"https://avatars.githubusercontent.com/u/1529364?v=3","gravatar_id":"","url":"https://api.github.com/users/rrahn","html_url":"https://github.com/rrahn","followers_url":"https://api.github.com/users/rrahn/followers","following_url":"https://api.github.com/users/rrahn/following{/other_user}","gists_url":"https://api.github.com/users/rrahn/gists{/gist_id}","starred_url":"https://api.github.com/users/rrahn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rrahn/subscriptions","organizations_url":"https://api.github.com/users/rrahn/orgs","repos_url":"https://api.github.com/users/rrahn/repos","events_url":"https://api.github.com/users/rrahn/events{/privacy}","received_events_url":"https://api.github.com/users/rrahn/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/seqan/seqan/milestones/7","html_url":"https://github.com/seqan/seqan/milestones/Release%202.0.2","labels_url":"https://api.github.com/repos/seqan/seqan/milestones/7/labels","id":1330833,"number":7,"title":"Release 2.0.2","description":"Hotfixes and minor changes.","creator":{"login":"esiragusa","id":172085,"avatar_url":"https://avatars.githubusercontent.com/u/172085?v=3","gravatar_id":"","url":"https://api.github.com/users/esiragusa","html_url":"https://github.com/esiragusa","followers_url":"https://api.github.com/users/esiragusa/followers","following_url":"https://api.github.com/users/esiragusa/following{/other_user}","gists_url":"https://api.github.com/users/esiragusa/gists{/gist_id}","starred_url":"https://api.github.com/users/esiragusa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esiragusa/subscriptions","organizations_url":"https://api.github.com/users/esiragusa/orgs","repos_url":"https://api.github.com/users/esiragusa/repos","events_url":"https://api.github.com/users/esiragusa/events{/privacy}","received_events_url":"https://api.github.com/users/esiragusa/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":63,"state":"open","created_at":"2015-09-30T10:21:02Z","updated_at":"2016-02-09T10:45:00Z","due_on":"2016-02-04T23:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/seqan/seqan/pulls/1429/commits","review_comments_url":"https://api.github.com/repos/seqan/seqan/pulls/1429/comments","review_comment_url":"https://api.github.com/repos/seqan/seqan/pulls/comments{/number}","comments_url":"https://api.github.com/repos/seqan/seqan/issues/1429/comments","statuses_url":"https://api.github.com/repos/seqan/seqan/statuses/1ce36bba6afaebe0e0fcd42668d242183055ecd9","head":{"label":"h-2:fix/packed_strings","ref":"fix/packed_strings","sha":"1ce36bba6afaebe0e0fcd42668d242183055ecd9","user":{"login":"h-2","id":2996863,"avatar_url":"https://avatars.githubusercontent.com/u/2996863?v=3","gravatar_id":"","url":"https://api.github.com/users/h-2","html_url":"https://github.com/h-2","followers_url":"https://api.github.com/users/h-2/followers","following_url":"https://api.github.com/users/h-2/following{/other_user}","gists_url":"https://api.github.com/users/h-2/gists{/gist_id}","starred_url":"https://api.github.com/users/h-2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h-2/subscriptions","organizations_url":"https://api.github.com/users/h-2/orgs","repos_url":"https://api.github.com/users/h-2/repos","events_url":"https://api.github.com/users/h-2/events{/privacy}","received_events_url":"https://api.github.com/users/h-2/received_events","type":"User","site_admin":false},"repo":{"id":17593904,"name":"seqan","full_name":"h-2/seqan","owner":{"login":"h-2","id":2996863,"avatar_url":"https://avatars.githubusercontent.com/u/2996863?v=3","gravatar_id":"","url":"https://api.github.com/users/h-2","html_url":"https://github.com/h-2","followers_url":"https://api.github.com/users/h-2/followers","following_url":"https://api.github.com/users/h-2/following{/other_user}","gists_url":"https://api.github.com/users/h-2/gists{/gist_id}","starred_url":"https://api.github.com/users/h-2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h-2/subscriptions","organizations_url":"https://api.github.com/users/h-2/orgs","repos_url":"https://api.github.com/users/h-2/repos","events_url":"https://api.github.com/users/h-2/events{/privacy}","received_events_url":"https://api.github.com/users/h-2/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/h-2/seqan","description":"SeqAn's official repository.","fork":true,"url":"https://api.github.com/repos/h-2/seqan","forks_url":"https://api.github.com/repos/h-2/seqan/forks","keys_url":"https://api.github.com/repos/h-2/seqan/keys{/key_id}","collaborators_url":"https://api.github.com/repos/h-2/seqan/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/h-2/seqan/teams","hooks_url":"https://api.github.com/repos/h-2/seqan/hooks","issue_events_url":"https://api.github.com/repos/h-2/seqan/issues/events{/number}","events_url":"https://api.github.com/repos/h-2/seqan/events","assignees_url":"https://api.github.com/repos/h-2/seqan/assignees{/user}","branches_url":"https://api.github.com/repos/h-2/seqan/branches{/branch}","tags_url":"https://api.github.com/repos/h-2/seqan/tags","blobs_url":"https://api.github.com/repos/h-2/seqan/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/h-2/seqan/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/h-2/seqan/git/refs{/sha}","trees_url":"https://api.github.com/repos/h-2/seqan/git/trees{/sha}","statuses_url":"https://api.github.com/repos/h-2/seqan/statuses/{sha}","languages_url":"https://api.github.com/repos/h-2/seqan/languages","stargazers_url":"https://api.github.com/repos/h-2/seqan/stargazers","contributors_url":"https://api.github.com/repos/h-2/seqan/contributors","subscribers_url":"https://api.github.com/repos/h-2/seqan/subscribers","subscription_url":"https://api.github.com/repos/h-2/seqan/subscription","commits_url":"https://api.github.com/repos/h-2/seqan/commits{/sha}","git_commits_url":"https://api.github.com/repos/h-2/seqan/git/commits{/sha}","comments_url":"https://api.github.com/repos/h-2/seqan/comments{/number}","issue_comment_url":"https://api.github.com/repos/h-2/seqan/issues/comments{/number}","contents_url":"https://api.github.com/repos/h-2/seqan/contents/{+path}","compare_url":"https://api.github.com/repos/h-2/seqan/compare/{base}...{head}","merges_url":"https://api.github.com/repos/h-2/seqan/merges","archive_url":"https://api.github.com/repos/h-2/seqan/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/h-2/seqan/downloads","issues_url":"https://api.github.com/repos/h-2/seqan/issues{/number}","pulls_url":"https://api.github.com/repos/h-2/seqan/pulls{/number}","milestones_url":"https://api.github.com/repos/h-2/seqan/milestones{/number}","notifications_url":"https://api.github.com/repos/h-2/seqan/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/h-2/seqan/labels{/name}","releases_url":"https://api.github.com/repos/h-2/seqan/releases{/id}","deployments_url":"https://api.github.com/repos/h-2/seqan/deployments","created_at":"2014-03-10T13:42:41Z","updated_at":"2015-09-03T13:21:01Z","pushed_at":"2016-02-08T15:54:00Z","git_url":"git://github.com/h-2/seqan.git","ssh_url":"git@github.com:h-2/seqan.git","clone_url":"https://github.com/h-2/seqan.git","svn_url":"https://github.com/h-2/seqan","homepage":"www.seqan.de","size":142539,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":0,"forks":2,"open_issues":0,"watchers":0,"default_branch":"feature/lambda"}},"base":{"label":"seqan:master","ref":"master","sha":"fcad60a03ff3a05e5c5b777100270eca17ee63ed","user":{"login":"seqan","id":1752144,"avatar_url":"https://avatars.githubusercontent.com/u/1752144?v=3","gravatar_id":"","url":"https://api.github.com/users/seqan","html_url":"https://github.com/seqan","followers_url":"https://api.github.com/users/seqan/followers","following_url":"https://api.github.com/users/seqan/following{/other_user}","gists_url":"https://api.github.com/users/seqan/gists{/gist_id}","starred_url":"https://api.github.com/users/seqan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seqan/subscriptions","organizations_url":"https://api.github.com/users/seqan/orgs","repos_url":"https://api.github.com/users/seqan/repos","events_url":"https://api.github.com/users/seqan/events{/privacy}","received_events_url":"https://api.github.com/users/seqan/received_events","type":"Organization","site_admin":false},"repo":{"id":6383869,"name":"seqan","full_name":"seqan/seqan","owner":{"login":"seqan","id":1752144,"avatar_url":"https://avatars.githubusercontent.com/u/1752144?v=3","gravatar_id":"","url":"https://api.github.com/users/seqan","html_url":"https://github.com/seqan","followers_url":"https://api.github.com/users/seqan/followers","following_url":"https://api.github.com/users/seqan/following{/other_user}","gists_url":"https://api.github.com/users/seqan/gists{/gist_id}","starred_url":"https://api.github.com/users/seqan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seqan/subscriptions","organizations_url":"https://api.github.com/users/seqan/orgs","repos_url":"https://api.github.com/users/seqan/repos","events_url":"https://api.github.com/users/seqan/events{/privacy}","received_events_url":"https://api.github.com/users/seqan/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/seqan/seqan","description":"SeqAn's official repository.","fork":false,"url":"https://api.github.com/repos/seqan/seqan","forks_url":"https://api.github.com/repos/seqan/seqan/forks","keys_url":"https://api.github.com/repos/seqan/seqan/keys{/key_id}","collaborators_url":"https://api.github.com/repos/seqan/seqan/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/seqan/seqan/teams","hooks_url":"https://api.github.com/repos/seqan/seqan/hooks","issue_events_url":"https://api.github.com/repos/seqan/seqan/issues/events{/number}","events_url":"https://api.github.com/repos/seqan/seqan/events","assignees_url":"https://api.github.com/repos/seqan/seqan/assignees{/user}","branches_url":"https://api.github.com/repos/seqan/seqan/branches{/branch}","tags_url":"https://api.github.com/repos/seqan/seqan/tags","blobs_url":"https://api.github.com/repos/seqan/seqan/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/seqan/seqan/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/seqan/seqan/git/refs{/sha}","trees_url":"https://api.github.com/repos/seqan/seqan/git/trees{/sha}","statuses_url":"https://api.github.com/repos/seqan/seqan/statuses/{sha}","languages_url":"https://api.github.com/repos/seqan/seqan/languages","stargazers_url":"https://api.github.com/repos/seqan/seqan/stargazers","contributors_url":"https://api.github.com/repos/seqan/seqan/contributors","subscribers_url":"https://api.github.com/repos/seqan/seqan/subscribers","subscription_url":"https://api.github.com/repos/seqan/seqan/subscription","commits_url":"https://api.github.com/repos/seqan/seqan/commits{/sha}","git_commits_url":"https://api.github.com/repos/seqan/seqan/git/commits{/sha}","comments_url":"https://api.github.com/repos/seqan/seqan/comments{/number}","issue_comment_url":"https://api.github.com/repos/seqan/seqan/issues/comments{/number}","contents_url":"https://api.github.com/repos/seqan/seqan/contents/{+path}","compare_url":"https://api.github.com/repos/seqan/seqan/compare/{base}...{head}","merges_url":"https://api.github.com/repos/seqan/seqan/merges","archive_url":"https://api.github.com/repos/seqan/seqan/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/seqan/seqan/downloads","issues_url":"https://api.github.com/repos/seqan/seqan/issues{/number}","pulls_url":"https://api.github.com/repos/seqan/seqan/pulls{/number}","milestones_url":"https://api.github.com/repos/seqan/seqan/milestones{/number}","notifications_url":"https://api.github.com/repos/seqan/seqan/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/seqan/seqan/labels{/name}","releases_url":"https://api.github.com/repos/seqan/seqan/releases{/id}","deployments_url":"https://api.github.com/repos/seqan/seqan/deployments","created_at":"2012-10-25T08:02:15Z","updated_at":"2016-02-09T13:17:51Z","pushed_at":"2016-02-09T13:16:06Z","git_url":"git://github.com/seqan/seqan.git","ssh_url":"git@github.com:seqan/seqan.git","clone_url":"https://github.com/seqan/seqan.git","svn_url":"https://github.com/seqan/seqan","homepage":"www.seqan.de","size":144843,"stargazers_count":109,"watchers_count":109,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":64,"mirror_url":null,"open_issues_count":123,"forks":64,"open_issues":123,"watchers":109,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/seqan/seqan/pulls/1429"},"html":{"href":"https://github.com/seqan/seqan/pull/1429"},"issue":{"href":"https://api.github.com/repos/seqan/seqan/issues/1429"},"comments":{"href":"https://api.github.com/repos/seqan/seqan/issues/1429/comments"},"review_comments":{"href":"https://api.github.com/repos/seqan/seqan/pulls/1429/comments"},"review_comment":{"href":"https://api.github.com/repos/seqan/seqan/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/seqan/seqan/pulls/1429/commits"},"statuses":{"href":"https://api.github.com/repos/seqan/seqan/statuses/1ce36bba6afaebe0e0fcd42668d242183055ecd9"}}}}