Lesser Ruby-warnings: warning: instance variable @txn not initialized

This commit is contained in:
Denis Knauf 2010-04-01 13:38:35 +02:00
parent 0fca4a27e0
commit ba288a0f4b

View file

@ -78,7 +78,8 @@ module SBDB
@home, @db = opts[:env], opts[:env] ? opts[:env].bdb_object.db : Bdb::Db.new @home, @db = opts[:env], opts[:env] ? opts[:env].bdb_object.db : Bdb::Db.new
opts[:type] = TYPES.index(self.class) || UNKNOWN opts[:type] = TYPES.index(self.class) || UNKNOWN
@db.re_len = opts[:re_len] if opts[:re_len] @db.re_len = opts[:re_len] if opts[:re_len]
@txn, txn = nil, opts[:txn] # First is the global txn, second only for open. @txn = nil
txn = opts[:txn] # First is the global txn, second only for open.
begin begin
@db.open txn && txn.bdb_object, file, opts[:name], opts[:type], opts[:flags] || 0, opts[:mode] || 0 @db.open txn && txn.bdb_object, file, opts[:name], opts[:type], opts[:flags] || 0, opts[:mode] || 0
rescue Object rescue Object