From: Robert Griesemer Date: Tue, 14 Dec 2010 01:08:01 +0000 (-0800) Subject: suffixarray: provide accessor to data X-Git-Tag: weekly.2010-12-15~33 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=52c9fb6f3dd0648c6ccb87ee20818b09ab43f9c9;p=gostls13.git 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 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]:] }