[LON-CAPA-cvs] cvs: loncom /debugging_tools clean_db.pl

albertel lon-capa-cvs-allow@mail.lon-capa.org
Tue, 03 Apr 2007 00:59:46 -0000


albertel		Mon Apr  2 20:59:46 2007 EDT

  Modified files:              
    /loncom/debugging_tools	clean_db.pl 
  Log:
  - speed up
  
  
Index: loncom/debugging_tools/clean_db.pl
diff -u loncom/debugging_tools/clean_db.pl:1.3 loncom/debugging_tools/clean_db.pl:1.4
--- loncom/debugging_tools/clean_db.pl:1.3	Tue Jun 27 10:35:24 2006
+++ loncom/debugging_tools/clean_db.pl	Mon Apr  2 20:59:45 2007
@@ -4,7 +4,7 @@
 #
 # dump_db.pl - dump a GDBM database to standard output, unescaping if asked to.
 #
-# $Id: clean_db.pl,v 1.3 2006/06/27 14:35:24 albertel Exp $
+# $Id: clean_db.pl,v 1.4 2007/04/03 00:59:45 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -65,8 +65,7 @@
     warn("Unable to tie to $fname");
     exit;
 }
-while (my ($key,$value) = each(%{$dbref})) {
-    if ($key ne $key_to_remove) { next; }
+if (exists($dbref->{$key_to_remove}) {
     delete($dbref->{$key});
     if ($fname =~ m|/nohist_[^/]*.db|) { exit; }
     my $hist=$fname;