edittemplate: only generate a UUID on-demand
If the template doesn't use <TMPL_VAR UUID> there's no point in incurring any cost.master
parent
7aa10a2952
commit
4a11dc4d16
|
@ -139,13 +139,15 @@ sub filltemplate ($$) {
|
|||
|
||||
$template->param(name => $page);
|
||||
|
||||
eval {
|
||||
require UUID::Tiny;
|
||||
UUID::Tiny->import(':std');
|
||||
my $uuid;
|
||||
$uuid = create_uuid_as_string(UUID_V4());
|
||||
$template->param(uuid => $uuid);
|
||||
};
|
||||
if ($template->query(name => 'uuid')) {
|
||||
eval {
|
||||
require UUID::Tiny;
|
||||
UUID::Tiny->import(':std');
|
||||
my $uuid;
|
||||
$uuid = create_uuid_as_string(UUID_V4());
|
||||
$template->param(uuid => $uuid);
|
||||
};
|
||||
}
|
||||
|
||||
return $template->output;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue