aboutsummaryrefslogtreecommitdiffstats
path: root/lib/LXRng/Index
diff options
context:
space:
mode:
Diffstat (limited to 'lib/LXRng/Index')
-rw-r--r--lib/LXRng/Index/DBI.pm3
-rw-r--r--lib/LXRng/Index/PgBatch.pm2
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/LXRng/Index/DBI.pm b/lib/LXRng/Index/DBI.pm
index 8fcb391..eeb6a83 100644
--- a/lib/LXRng/Index/DBI.pm
+++ b/lib/LXRng/Index/DBI.pm
@@ -471,7 +471,8 @@ sub get_symbol_usage {
my %rlines;
foreach my $r (@$res) {
- $rlines{$$r[0]} = [$$r[1] =~ /(\d+),?/g];
+ $rlines{$$r[0]} = ref($$r[1]) eq 'ARRAY'
+ ? $$r[1] : [$$r[1] =~ /(\d+),?/g];
}
return \%rlines;
diff --git a/lib/LXRng/Index/PgBatch.pm b/lib/LXRng/Index/PgBatch.pm
index c1b30eb..7bd67e6 100644
--- a/lib/LXRng/Index/PgBatch.pm
+++ b/lib/LXRng/Index/PgBatch.pm
@@ -52,7 +52,7 @@ sub transaction {
# Only occasional synchronization if we're inside another
# transaction.
# TODO: Check fill grade of caches and flush based on that.
- if ($self->{'writes'}++ % 491 == 0) {
+ if ($self->{'writes'}++ % 3259 == 0) {
$self->flush();
$self->dbh->commit();
}