Skip to content

Commit

Permalink
replaced all just with parent check for txn
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilya Miheev committed Jun 13, 2024
1 parent 5822531 commit 6a99905
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions mdbx/txn.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,7 @@ func beginTxn(env *Env, parent *Txn, flags uint) (*Txn, error) {
}

var ptxn *C.MDBX_txn
if parent == nil {
if flags&Readonly == 0 {
// In a write Txn we can use the shared, C-allocated key and value
// allocated by env, and freed when it is closed.
txn.key = *env.ckey
}
} else {
if parent != nil {
// Because parent Txn objects cannot be used while a sub-Txn is active
// it is OK for them to share their C.MDBX_val objects.
ptxn = parent._txn
Expand Down

0 comments on commit 6a99905

Please sign in to comment.