aboutsummaryrefslogtreecommitdiffstats
path: root/Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/util.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-10-22 00:14:11 +0800
committerGitHub <noreply@github.com>2016-10-22 00:14:11 +0800
commit890ffa05f84a4701646a0ad556d22a536cfd9424 (patch)
treee08cdc2c33ab7cf211916f7d3d7ab37e496a963c /Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/util.go
parent89014b4524ecb8bd36d7db2d45ea7b609c01f1a4 (diff)
parentb930baa58078862d082745330038e60d0767026c (diff)
downloadgo-tangerine-890ffa05f84a4701646a0ad556d22a536cfd9424.tar.gz
go-tangerine-890ffa05f84a4701646a0ad556d22a536cfd9424.tar.zst
go-tangerine-890ffa05f84a4701646a0ad556d22a536cfd9424.zip
Merge pull request #3189 from fjl/leveldb-update
Update goleveldb, add debug.chaindbCompact
Diffstat (limited to 'Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/util.go')
-rw-r--r--Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/util.go7
1 files changed, 7 insertions, 0 deletions
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]
+}