]> Cypherpunks repositories - gostls13.git/commitdiff
Small addition to previous optimization of memequal as discussed here: http://groups...
authorGraham Miller <graham.miller@gmail.com>
Thu, 4 Nov 2010 20:45:18 +0000 (13:45 -0700)
committerRob Pike <r@golang.org>
Thu, 4 Nov 2010 20:45:18 +0000 (13:45 -0700)
R=golang-dev, r, r2
CC=golang-dev
https://golang.org/cl/2880041

src/pkg/runtime/runtime.c

index 0b19e108ed1b2c09e402689564f0282d54c6d75c..f2b6c587e92c278482d00035644bdd3018ba6b97 100644 (file)
@@ -320,6 +320,8 @@ memequal(uint32 s, void *a, void *b)
 {
        byte *ba, *bb, *aend;
 
+       if(a == b)
+         return 1;
        ba = a;
        bb = b;
        aend = ba+s;