aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/syndtr/goleveldb/leveldb/storage/mem_storage.go
diff options
context:
space:
mode:
authorale <ale@incal.net>2018-08-31 08:28:51 +0100
committerale <ale@incal.net>2018-08-31 08:28:51 +0100
commitb3d419486a87c9193c2fd6c16168f600876e0f73 (patch)
tree849d1333d4fac8e5654e65a0fdf4b2cb00355ab9 /vendor/github.com/syndtr/goleveldb/leveldb/storage/mem_storage.go
parent86a0bd2d15a07662fdae4e24589b08706c2e80b9 (diff)
downloadcrawl-b3d419486a87c9193c2fd6c16168f600876e0f73.tar.gz
crawl-b3d419486a87c9193c2fd6c16168f600876e0f73.zip
Update dependencies
Diffstat (limited to 'vendor/github.com/syndtr/goleveldb/leveldb/storage/mem_storage.go')
-rw-r--r--vendor/github.com/syndtr/goleveldb/leveldb/storage/mem_storage.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/storage/mem_storage.go b/vendor/github.com/syndtr/goleveldb/leveldb/storage/mem_storage.go
index 9b0421f..838f1be 100644
--- a/vendor/github.com/syndtr/goleveldb/leveldb/storage/mem_storage.go
+++ b/vendor/github.com/syndtr/goleveldb/leveldb/storage/mem_storage.go
@@ -12,7 +12,11 @@ import (
"sync"
)
-const typeShift = 3
+const typeShift = 4
+
+// Verify at compile-time that typeShift is large enough to cover all FileType
+// values by confirming that 0 == 0.
+var _ [0]struct{} = [TypeAll >> typeShift]struct{}{}
type memStorageLock struct {
ms *memStorage
@@ -143,7 +147,7 @@ func (ms *memStorage) Remove(fd FileDesc) error {
}
func (ms *memStorage) Rename(oldfd, newfd FileDesc) error {
- if FileDescOk(oldfd) || FileDescOk(newfd) {
+ if !FileDescOk(oldfd) || !FileDescOk(newfd) {
return ErrInvalidFile
}
if oldfd == newfd {