From: Dmitriy Vyukov Date: Wed, 26 Mar 2014 11:03:58 +0000 (+0400) Subject: runtime: minor improvement of string scanning X-Git-Tag: go1.3beta1~264 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=40f5e67571d6ce299140638e40bea6b00cc76330;p=gostls13.git runtime: minor improvement of string scanning If we set obj, then it will be enqueued for marking at the end of the scanning loop. This is not necessary, since we've already marked it. This can wait for 1.4 if you wish. LGTM=rsc R=rsc CC=golang-codereviews https://golang.org/cl/80030043 --- diff --git a/src/pkg/runtime/mgc0.c b/src/pkg/runtime/mgc0.c index c16bac1a0d..ec6712cbf9 100644 --- a/src/pkg/runtime/mgc0.c +++ b/src/pkg/runtime/mgc0.c @@ -913,10 +913,8 @@ scanblock(Workbuf *wbuf, bool keepworking) case GC_STRING: stringptr = (String*)(stack_top.b + pc[1]); - if(stringptr->len != 0) { - obj = stringptr->str; - markonly(obj); - } + if(stringptr->len != 0) + markonly(stringptr->str); pc += 2; continue;