From b930baa58078862d082745330038e60d0767026c Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Thu, 20 Oct 2016 14:56:34 +0200 Subject: Godeps: update github.com/syndtr/goleveldb to 6b4daa5362 --- Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/util.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/util.go') diff --git a/Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/util.go b/Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/util.go index 3b663d1cc..e572a329e 100644 --- a/Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/util.go +++ b/Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/util.go @@ -89,3 +89,10 @@ func (p fdSorter) Swap(i, j int) { func sortFds(fds []storage.FileDesc) { sort.Sort(fdSorter(fds)) } + +func ensureBuffer(b []byte, n int) []byte { + if cap(b) < n { + return make([]byte, n) + } + return b[:n] +} -- cgit