]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: minor improvement of string scanning
authorDmitriy Vyukov <dvyukov@google.com>
Wed, 26 Mar 2014 11:03:58 +0000 (15:03 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Wed, 26 Mar 2014 11:03:58 +0000 (15:03 +0400)
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

src/pkg/runtime/mgc0.c

index c16bac1a0d3b67fe380dcd0ab4c0df68d6be5d7e..ec6712cbf99574b84bac8efeed77380552785ac0 100644 (file)
@@ -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;