diff options
author | Robert Griesemer <gri@golang.org> | 2010-12-13 17:08:01 -0800 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2010-12-13 17:08:01 -0800 |
commit | 52c9fb6f3dd0648c6ccb87ee20818b09ab43f9c9 (patch) | |
tree | 38b7e664b4b222587bc9ad35a60eec77a4e30725 | |
parent | 7ff68b365b68a7afa116b4dac0f1dcad989daa22 (diff) | |
download | go-52c9fb6f3dd0648c6ccb87ee20818b09ab43f9c9.tar.gz go-52c9fb6f3dd0648c6ccb87ee20818b09ab43f9c9.zip |
suffixarray: provide accessor to data
R=r
CC=golang-dev
https://golang.org/cl/3574044
-rw-r--r-- | src/pkg/index/suffixarray/suffixarray.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/pkg/index/suffixarray/suffixarray.go b/src/pkg/index/suffixarray/suffixarray.go index 2d728e2c3a..0a8d9e2cb8 100644 --- a/src/pkg/index/suffixarray/suffixarray.go +++ b/src/pkg/index/suffixarray/suffixarray.go @@ -49,6 +49,14 @@ func New(data []byte) *Index { } +// 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]:] } |