Skip to content

Commit

Permalink
improved html_unescape and url_unescape performance slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 30, 2014
1 parent ddff39c commit 4b329bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Changes
@@ -1,6 +1,7 @@

4.73 2014-01-30
- Improved xml_escape performance significantly.
- Improved xml_escape and url_unescape performance significantly.
- Improved html_unescape and url_unescape performance.

4.72 2014-01-29
- Added accepts, template_for and template_handler methods to
Expand Down
2 changes: 0 additions & 2 deletions lib/Mojo/Util.pm
Expand Up @@ -127,7 +127,6 @@ sub hmac_sha1_sum { hmac_sha1_hex(@_) }
sub html_unescape {
my $str = shift;
return $str if index($str, '&') == -1;
$str =~ s/&(?:\#((?:\d{1,7}|x[0-9a-fA-F]{1,6}));|(\w+;?))/_decode($1, $2)/ge;
return $str;
}
Expand Down Expand Up @@ -327,7 +326,6 @@ sub url_escape {

sub url_unescape {
my $str = shift;
return $str if index($str, '%') == -1;
$str =~ s/%([0-9a-fA-F]{2})/chr(hex($1))/ge;
return $str;
}
Expand Down

0 comments on commit 4b329bd

Please sign in to comment.