diff options
author | Péter Szilágyi <peterke@gmail.com> | 2015-05-07 19:40:50 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2015-05-07 19:40:50 +0800 |
commit | 43901c92825389b694fb5488c520cf5122f022de (patch) | |
tree | cb3954ab520d201f80764e81fb574d34b5b9c0f1 /Godeps/_workspace/src/gopkg.in/karalabe/cookiejar.v2/collections/prque/sstack.go | |
parent | 45f8304f3c44e5379c7e30ab144d73e591e270af (diff) | |
download | go-tangerine-43901c92825389b694fb5488c520cf5122f022de.tar go-tangerine-43901c92825389b694fb5488c520cf5122f022de.tar.gz go-tangerine-43901c92825389b694fb5488c520cf5122f022de.tar.bz2 go-tangerine-43901c92825389b694fb5488c520cf5122f022de.tar.lz go-tangerine-43901c92825389b694fb5488c520cf5122f022de.tar.xz go-tangerine-43901c92825389b694fb5488c520cf5122f022de.tar.zst go-tangerine-43901c92825389b694fb5488c520cf5122f022de.zip |
eth/downloader: fix priority queue reset, add throttling test
Diffstat (limited to 'Godeps/_workspace/src/gopkg.in/karalabe/cookiejar.v2/collections/prque/sstack.go')
-rw-r--r-- | Godeps/_workspace/src/gopkg.in/karalabe/cookiejar.v2/collections/prque/sstack.go | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Godeps/_workspace/src/gopkg.in/karalabe/cookiejar.v2/collections/prque/sstack.go b/Godeps/_workspace/src/gopkg.in/karalabe/cookiejar.v2/collections/prque/sstack.go index 55375a091..c11347f9d 100644 --- a/Godeps/_workspace/src/gopkg.in/karalabe/cookiejar.v2/collections/prque/sstack.go +++ b/Godeps/_workspace/src/gopkg.in/karalabe/cookiejar.v2/collections/prque/sstack.go @@ -88,7 +88,7 @@ func (s *sstack) Less(i, j int) bool { return s.blocks[i/blockSize][i%blockSize].priority > s.blocks[j/blockSize][j%blockSize].priority } -// Swapts two elements in the stack. Required by sort.Interface. +// Swaps two elements in the stack. Required by sort.Interface. func (s *sstack) Swap(i, j int) { ib, io, jb, jo := i/blockSize, i%blockSize, j/blockSize, j%blockSize s.blocks[ib][io], s.blocks[jb][jo] = s.blocks[jb][jo], s.blocks[ib][io] @@ -96,8 +96,5 @@ func (s *sstack) Swap(i, j int) { // Resets the stack, effectively clearing its contents. func (s *sstack) Reset() { - s.size = 0 - s.offset = 0 - s.active = s.blocks[0] - s.capacity = blockSize + *s = *newSstack() } |