commit | 52c9fb6f3dd0648c6ccb87ee20818b09ab43f9c9 | [log] [tgz] |
---|---|---|
author | Robert Griesemer <gri@golang.org> | Mon Dec 13 17:08:01 2010 -0800 |
committer | Robert Griesemer <gri@golang.org> | Mon Dec 13 17:08:01 2010 -0800 |
tree | 38b7e664b4b222587bc9ad35a60eec77a4e30725 | |
parent | 7ff68b365b68a7afa116b4dac0f1dcad989daa22 [diff] [blame] |
suffixarray: provide accessor to data R=r CC=golang-dev https://golang.org/cl/3574044
diff --git a/src/pkg/index/suffixarray/suffixarray.go b/src/pkg/index/suffixarray/suffixarray.go index 2d728e2..0a8d9e2 100644 --- a/src/pkg/index/suffixarray/suffixarray.go +++ b/src/pkg/index/suffixarray/suffixarray.go
@@ -49,6 +49,14 @@ } +// Data returns the data over which the index was created. +// It must not be modified. +// +func (x *Index) Data() []byte { + return x.data +} + + func (x *Index) at(i int) []byte { return x.data[x.sa[i]:] }