From 62355959c6b56f90f2b83f4a766598d734d8785f Mon Sep 17 00:00:00 2001 From: Graham Miller Date: Thu, 7 Oct 2010 03:13:24 -0400 Subject: [PATCH] runtime: faster strequal, memequal Fixes #1161. R=rsc, cwvh CC=golang-dev https://golang.org/cl/2317044 --- src/pkg/runtime/runtime.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/pkg/runtime/runtime.c b/src/pkg/runtime/runtime.c index 71eb8d6b56..4b09f7bcf7 100644 --- a/src/pkg/runtime/runtime.c +++ b/src/pkg/runtime/runtime.c @@ -310,14 +310,18 @@ memhash(uint32 s, void *a) static uint32 memequal(uint32 s, void *a, void *b) { - byte *ba, *bb; + byte *ba, *bb, *aend; uint32 i; ba = a; bb = b; - for(i=0; ilen; + if(alen != b->len) + return false; + return memequal(alen, a->str, b->str); } static void -- 2.50.0