aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/runtime.c
diff options
context:
space:
mode:
authorGraham Miller <graham.miller@gmail.com>2010-11-04 13:45:18 -0700
committerRob Pike <r@golang.org>2010-11-04 13:45:18 -0700
commit23c41a1ef2157da8df646a78f93d9b6e39a85a87 (patch)
tree9163093bf30e410f4d267bbf290261a2a25cfa72 /src/pkg/runtime/runtime.c
parent3a50d721a866c22f08d01eba770d62015e162242 (diff)
downloadgo-23c41a1ef2157da8df646a78f93d9b6e39a85a87.tar.xz
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
Diffstat (limited to 'src/pkg/runtime/runtime.c')
-rw-r--r--src/pkg/runtime/runtime.c2
1 files changed, 2 insertions, 0 deletions
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;