From: Graham Miller Date: Thu, 4 Nov 2010 20:45:18 +0000 (-0700) Subject: Small addition to previous optimization of memequal as discussed here: http://groups... X-Git-Tag: weekly.2010-11-10~35 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=23c41a1ef2157da8df646a78f93d9b6e39a85a87;p=gostls13.git Small addition to previous optimization of memequal as discussed here: http://groups.google.com/group/golang-nuts/browse_thread/thread/f591ba36d83723c0/9aba02d344045f38 R=golang-dev, r, r2 CC=golang-dev https://golang.org/cl/2880041 --- diff --git a/src/pkg/runtime/runtime.c b/src/pkg/runtime/runtime.c index 0b19e108ed..f2b6c587e9 100644 --- a/src/pkg/runtime/runtime.c +++ b/src/pkg/runtime/runtime.c @@ -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;