Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
1f1ae404
Commit
1f1ae404
authored
Sep 30, 2008
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
for loops in hashmap.
a few missing FLUSH. R=ken OCL=16221 CL=16221
parent
a05c59fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
36 deletions
+28
-36
src/runtime/iface.c
src/runtime/iface.c
+28
-36
No files found.
src/runtime/iface.c
View file @
1f1ae404
...
...
@@ -131,44 +131,34 @@ hashmap(Sigi *si, Sigt *st)
m
->
sigi
=
si
;
m
->
sigt
=
st
;
ni
=
1
;
// skip first word
nt
=
0
;
loop1:
// pick up next name from
// interface signature
iname
=
si
[
ni
].
name
;
if
(
iname
==
nil
)
{
m
->
link
=
hash
[
h
];
hash
[
h
]
=
m
;
// prints("new hashmap\n");
return
m
;
}
ihash
=
si
[
ni
].
hash
;
loop2:
// pick up and comapre next name
// from structure signature
sname
=
st
[
nt
].
name
;
if
(
sname
==
nil
)
{
prints
((
int8
*
)
iname
);
prints
(
": "
);
throw
(
"hashmap: failed to find method"
);
m
->
bad
=
1
;
m
->
link
=
hash
[
h
];
hash
[
h
]
=
m
;
return
nil
;
}
if
(
ihash
!=
st
[
nt
].
hash
||
strcmp
(
sname
,
iname
)
!=
0
)
{
nt
++
;
goto
loop2
;
for
(
ni
=
1
;
(
iname
=
si
[
ni
].
name
)
!=
nil
;
ni
++
)
{
// ni=1: skip first word
// pick up next name from
// interface signature
ihash
=
si
[
ni
].
hash
;
for
(;;
nt
++
)
{
// pick up and compare next name
// from structure signature
sname
=
st
[
nt
].
name
;
if
(
sname
==
nil
)
{
prints
((
int8
*
)
iname
);
prints
(
": "
);
throw
(
"hashmap: failed to find method"
);
m
->
bad
=
1
;
m
->
link
=
hash
[
h
];
hash
[
h
]
=
m
;
return
nil
;
}
if
(
ihash
==
st
[
nt
].
hash
&&
strcmp
(
sname
,
iname
)
==
0
)
break
;
}
m
->
fun
[
si
[
ni
].
perm
]
=
st
[
nt
].
fun
;
}
m
->
fun
[
si
[
ni
].
perm
]
=
st
[
nt
].
fun
;
ni
++
;
goto
loop1
;
m
->
link
=
hash
[
h
];
hash
[
h
]
=
m
;
// prints("new hashmap\n")
;
return
m
;
}
// ifaceT2I(sigi *byte, sigt *byte, elem any) (ret any);
...
...
@@ -196,6 +186,7 @@ sys·ifaceT2I(Sigi *si, Sigt *st, void *elem, Map *retim, void *retit)
}
FLUSH
(
&
retim
);
FLUSH
(
&
retit
);
}
// ifaceI2T(sigt *byte, iface any) (ret any);
...
...
@@ -257,6 +248,7 @@ sys·ifaceI2I(Sigi *si, Map *im, void *it, Map *retim, void *retit)
}
FLUSH
(
&
retim
);
FLUSH
(
&
retit
);
}
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