Skip to content
Browse files

Convert get_seen() to just seen()

which means don't tie a new handle every time it is called.
  • Loading branch information...
1 parent 9dcc09e commit 7bfb42ba20bc57f9bb9fd76ed1948ffb91256a35 @afresh1 committed Jul 9, 2012
Showing with 7 additions and 3 deletions.
  1. +7 −3 commits-to-twitter.pl
View
10 commits-to-twitter.pl
@@ -59,7 +59,7 @@
sub check_message {
my ($file) = @_;
- state $seen = load_seen();
+ my $seen = seen();
my $commit = parse_commit($file);
return unless $commit;
@@ -275,9 +275,13 @@ sub parse_commit {
{
my $X;
+ my %seen;
+
+ sub seen {
+ return \%seen if %seen;
+
+ $X = tie %seen, 'DB_File', $seen_file or die;
- sub load_seen {
- $X = tie my %seen, 'DB_File', $seen_file or die;
return \%seen;
}

0 comments on commit 7bfb42b

Please sign in to comment.
Something went wrong with that request. Please try again.