1
0
mirror of https://github.com/golang/go synced 2024-11-17 12:24:51 -07:00

internal/bytealg: fix typo in IndexRabinKarp{,Bytes} godoc

Change-Id: I09ba19e19b195e345a0fe29d542e0d86529b0d31
Reviewed-on: https://go-review.googlesource.com/c/go/+/261359
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Tobias Klauser 2020-10-12 11:19:41 +02:00 committed by Tobias Klauser
parent c8fdfa756e
commit e69f6e8393

View File

@ -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)
@ -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)