]> Cypherpunks repositories - gostls13.git/commitdiff
suffixarray: provide accessor to data
authorRobert Griesemer <gri@golang.org>
Tue, 14 Dec 2010 01:08:01 +0000 (17:08 -0800)
committerRobert Griesemer <gri@golang.org>
Tue, 14 Dec 2010 01:08:01 +0000 (17:08 -0800)
R=r
CC=golang-dev
https://golang.org/cl/3574044

src/pkg/index/suffixarray/suffixarray.go

index 2d728e2c3aeb511856235a5ab03e6b2a6e6f9936..0a8d9e2cb8b770826eea756c32d211b35ded016b 100644 (file)
@@ -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]:]
 }