mirror of
https://github.com/golang/go.git
synced 2025-11-11 22:21:06 +00:00
runtime: unify fastrand1 and fastrand2
C and Go calling conventions are now compatible, so we don't need two versions of this function. LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/139080043
This commit is contained in:
parent
1d8fa7fa5d
commit
3306d119b0
10 changed files with 10 additions and 26 deletions
|
|
@ -219,7 +219,7 @@ func makemap(t *maptype, hint int64) *hmap {
|
|||
h.count = 0
|
||||
h.B = B
|
||||
h.flags = 0
|
||||
h.hash0 = fastrand2()
|
||||
h.hash0 = fastrand1()
|
||||
h.buckets = buckets
|
||||
h.oldbuckets = nil
|
||||
h.nevacuate = 0
|
||||
|
|
@ -568,7 +568,7 @@ func mapiterinit(t *maptype, h *hmap, it *hiter) {
|
|||
|
||||
// iterator state
|
||||
it.bucket = 0
|
||||
it.offset = uint8(fastrand2() & (bucketCnt - 1))
|
||||
it.offset = uint8(fastrand1() & (bucketCnt - 1))
|
||||
it.done = false
|
||||
it.bptr = nil
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue