aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoubleWoodH <3155965489@qq.com>2018-04-09 18:38:01 +0800
committerFelix Lange <fjl@users.noreply.github.com>2018-04-09 18:38:01 +0800
commit8de655ef3a60053b564f609fd5c889face69f431 (patch)
treea9aafdf6af8a7f199623726838e8bdc24428c52d
parent3ebcf92b423e67b58a72a3fc126449e4e97bc4c8 (diff)
downloadgo-tangerine-8de655ef3a60053b564f609fd5c889face69f431.tar.gz
go-tangerine-8de655ef3a60053b564f609fd5c889face69f431.tar.zst
go-tangerine-8de655ef3a60053b564f609fd5c889face69f431.zip
bmt: fix comment typos (#16461)
-rw-r--r--bmt/bmt.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/bmt/bmt.go b/bmt/bmt.go
index 4b65b1d94..340875867 100644
--- a/bmt/bmt.go
+++ b/bmt/bmt.go
@@ -75,7 +75,7 @@ type Hasher struct {
blocksize int // segment size (size of hash) also for hash.Hash
count int // segment count
size int // for hash.Hash same as hashsize
- cur int // cursor position for righmost currently open chunk
+ cur int // cursor position for rightmost currently open chunk
segment []byte // the rightmost open segment (not complete)
depth int // index of last level
result chan []byte // result channel
@@ -149,7 +149,7 @@ func NewTreePool(hasher BaseHasher, segmentCount, capacity int) *TreePool {
}
}
-// Drain drains the pool uptil it has no more than n resources
+// Drain drains the pool until it has no more than n resources
func (self *TreePool) Drain(n int) {
self.lock.Lock()
defer self.lock.Unlock()
@@ -412,11 +412,10 @@ func (self *Hasher) Reset() {
// ResetWithLength needs to be called before writing to the hasher
// the argument is supposed to be the byte slice binary representation of
-// the legth of the data subsumed under the hash
+// the length of the data subsumed under the hash
func (self *Hasher) ResetWithLength(l []byte) {
self.Reset()
self.blockLength = l
-
}
// Release gives back the Tree to the pool whereby it unlocks
@@ -531,7 +530,7 @@ func (self *Hasher) finalise(n *Node, i int) (d int) {
for {
// when the final segment's path is going via left segments
// the incoming data is pushed to the parent upon pulling the left
- // we do not need toogle the state since this condition is
+ // we do not need toggle the state since this condition is
// detectable
n.unbalanced = isLeft
n.right = nil