Browse files

shorten escape code initialization

  • Loading branch information...
1 parent 0e1d3e3 commit 526b83c15f4dcc86f66089c05229e759c6bd6cf7 @moritz moritz committed Mar 29, 2012
Showing with 4 additions and 5 deletions.
  1. +4 −5 lib/URI/Escape.pm
View
9 lib/URI/Escape.pm
@@ -4,11 +4,10 @@ package URI::Escape {
use IETF::RFC_Grammar::URI;
- my %escapes = ();
-
- for 0 .. 255 -> $c { # map broken in module / package ?
- %escapes{ chr($c) } = sprintf '%%%02X', $c
- }
+ my %escapes = (^256).map: {
+ ;
+ .chr => sprintf '%%%02X', $_
+ };
# in moving from RFC 2396 to RFC 3986 this selection of characters
# may be due for an update ...

0 comments on commit 526b83c

Please sign in to comment.