瀏覽代碼

Refactored master loading a bit for readability

Alois Mahdal 11 年之前
父節點
當前提交
0c9d435218
共有 1 個檔案被更改,包括 5 行新增3 行删除
  1. 5
    3
      lib/SugarTrail/Repo.pm

+ 5
- 3
lib/SugarTrail/Repo.pm 查看文件

@@ -24,11 +24,13 @@ sub load_master {
24 24
     my $self = shift;
25 25
     my $args = { @_ };
26 26
 
27
+    my $src = $args->{source};
28
+
27 29
     my $master = SugarTrail::Template::Master->new();
28
-    $master->{text} = $self->load_text($args->{source})
30
+    $master->{source} = $src;
31
+    $master->{revision} = $self->get_revision($src);
32
+    $master->{text} = $self->load_text($src)
29 33
         or return;
30
-    $master->{source} = $args->{source};
31
-    $master->{revision} = $self->get_revision($args->{source});
32 34
 
33 35
     return $master;
34 36
 }