From f52f485ae68a62cd6183224ba535c88a35928768 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Tue, 10 May 2011 08:19:13 +0200 Subject: bdb: don't retrieve the db values when warning about nil key When either of the keys passed to the BDB compare function is nil, we emit a warning. In this warning, however, we used to peek at the registry value, which required the use of the comparison function itself, falling in a nested loop. Solve by omitting the self[].inspect from the warning. --- lib/rbot/registry/bdb.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rbot/registry/bdb.rb b/lib/rbot/registry/bdb.rb index d1876ac5..2403ec0e 100644 --- a/lib/rbot/registry/bdb.rb +++ b/lib/rbot/registry/bdb.rb @@ -36,7 +36,7 @@ module BDB class CIBtree < Btree def bdb_bt_compare(a, b) if a == nil || b == nil - warning "CIBTree: comparing #{a.inspect} (#{self[a].inspect}) with #{b.inspect} (#{self[b].inspect})" + warning "CIBTree: comparing key #{a.inspect} with #{b.inspect}" end (a||'').downcase <=> (b||'').downcase end -- cgit v1.2.3