diff options
| author | Graham Miller <graham.miller@gmail.com> | 2010-11-04 13:45:18 -0700 |
|---|---|---|
| committer | Rob Pike <r@golang.org> | 2010-11-04 13:45:18 -0700 |
| commit | 23c41a1ef2157da8df646a78f93d9b6e39a85a87 (patch) | |
| tree | 9163093bf30e410f4d267bbf290261a2a25cfa72 /src/pkg/runtime/runtime.c | |
| parent | 3a50d721a866c22f08d01eba770d62015e162242 (diff) | |
| download | go-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.c | 2 |
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; |
