Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Convert get_seen() to just seen()

which means don't tie a new handle every time it is called.
  • Loading branch information...
commit 7bfb42ba20bc57f9bb9fd76ed1948ffb91256a35 1 parent 9dcc09e
@afresh1 authored
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;
}
Please sign in to comment.
Something went wrong with that request. Please try again.