2. speeded up the show/node command by using the DB_File interface and
[spider.git] / cmd / show / isolate.pl
index bea994fa7af2e112e16a0fcbeb5e5d1aa50f41ce..c874e8a8f930f46ef16e818da4de018238dea7af 100644 (file)
 my ($self, $line) = @_;
 return (1, $self->msg('e5')) unless $self->priv >= 1;
 
-# search thru the user for nodes
-my @out = sort map { my $ref; (($ref = DXUser->get_current($_)) && $ref->isolate) ? $_ : () } DXUser::get_all_calls;
-return (1, @out);
+my @out;
+
+use DB_File;
+
+my ($action, $count, $key, $data);
+for ($action = R_FIRST, $count = 0; !$DXUser::dbm->seq($key, $data, $action); $action = R_NEXT) {
+       if ($data =~ m{isolate =>}) {
+               my $u = DXUser->get_current($key);
+               if ($u && $u->isolate) {
+                       push @out, $key;
+                       ++$count;
+               }
+       }
+} 
+
+return (1, @out, $self->msg('rec', $count));
+
+