Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
62355959
Commit
62355959
authored
Oct 07, 2010
by
Graham Miller
Committed by
Russ Cox
Oct 07, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runtime: faster strequal, memequal
Fixes #1161. R=rsc, cwvh CC=golang-dev
https://golang.org/cl/2317044
parent
4ed13282
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
runtime.c
src/pkg/runtime/runtime.c
+13
-4
No files found.
src/pkg/runtime/runtime.c
View file @
62355959
...
...
@@ -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
;
i
<
s
;
i
++
)
if
(
ba
[
i
]
!=
bb
[
i
])
aend
=
ba
+
s
;
while
(
ba
!=
aend
)
{
if
(
*
ba
!=
*
bb
)
return
0
;
ba
++
;
bb
++
;
}
return
1
;
}
...
...
@@ -389,8 +393,13 @@ strhash(uint32 s, String *a)
static
uint32
strequal
(
uint32
s
,
String
*
a
,
String
*
b
)
{
int32
alen
;
USED
(
s
);
return
cmpstring
(
*
a
,
*
b
)
==
0
;
alen
=
a
->
len
;
if
(
alen
!=
b
->
len
)
return
false
;
return
memequal
(
alen
,
a
->
str
,
b
->
str
);
}
static
void
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment