Skip to content

Commit

Permalink
internal/bytealg: fix typo in IndexRabinKarp{,Bytes} godoc
Browse files Browse the repository at this point in the history
Change-Id: I09ba19e19b195e345a0fe29d542e0d86529b0d31
Reviewed-on: https://go-review.googlesource.com/c/go/+/261359
Trust: Tobias Klauser <[email protected]>
Run-TryBot: Tobias Klauser <[email protected]>
TryBot-Result: Go Bot <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
  • Loading branch information
tklauser committed Oct 13, 2020
1 parent c8fdfa7 commit e69f6e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/internal/bytealg/bytealg.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func HashStrRev(sep string) (uint32, uint32) {
}

// IndexRabinKarpBytes uses the Rabin-Karp search algorithm to return the index of the
// first occurence of substr in s, or -1 if not present.
// first occurrence of substr in s, or -1 if not present.
func IndexRabinKarpBytes(s, sep []byte) int {
// Rabin-Karp search
hashsep, pow := HashStrBytes(sep)
Expand All @@ -124,7 +124,7 @@ func IndexRabinKarpBytes(s, sep []byte) int {
}

// IndexRabinKarp uses the Rabin-Karp search algorithm to return the index of the
// first occurence of substr in s, or -1 if not present.
// first occurrence of substr in s, or -1 if not present.
func IndexRabinKarp(s, substr string) int {
// Rabin-Karp search
hashss, pow := HashStr(substr)
Expand Down

0 comments on commit e69f6e8

Please sign in to comment.