Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update HTML.pm #25

Closed
wants to merge 1 commit into from
Closed

Update HTML.pm #25

wants to merge 1 commit into from

Conversation

trosel
Copy link

@trosel trosel commented Feb 24, 2017

group multis together, change a multi to a switch, utilize samewith instead of recurse, s/returns/--> Str/

group multis together, change a multi to a switch, utilize samewith instead of recurse, s/returns/--> Str/
Copy link

@zoffixznet zoffixznet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, I suspect this has a measurable negative performance impact and our docs build is slow as it is. I'd suggest measuring what that impact is first.

The multi code can be cleaned up by using captures instead:

    multi method render(Array $pod, |c) { pod2html $pod, |c }

Although that'd make less-obvious error messages when incorrect args are given.

}
when Pod::Block {
pod2html($pod, :$header, :$footer, :$head, :$default-title, :$lang)
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+ when Array {
+ pod2html($pod, :$header, :$footer, :$head, :$default-title, :$lang)
+ }
+ when Pod::Block {
+ pod2html($pod, :$header, :$footer, :$head, :$default-title, :$lang)
+ }

that can be written as just

when Array | Pod::Block { pod2html($pod, :$header, :$footer, :$head, :$default-title, :$lang)}

}
when Str {
use MONKEY-SEE-NO-EVAL;
pod2html(EVAL($pod-string ~ "\n\$=pod"), :$header, :$footer, :$head, :$default-title, :$lang);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You still use $file and $pod-string here, despite changing the variable name to $pod. Please run make test on the changes.

@trosel trosel closed this Feb 24, 2017
@zoffixznet zoffixznet deleted the WildYorkies-patch-1 branch February 24, 2017 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants