Permalink
Browse files

leave utf8::is_utf8 to short-circuit wide char check, for optimization.

  • Loading branch information...
1 parent 7994a86 commit 94cf6bbea2f36e2d17eeed3089ff7563857dc59d @miyagawa miyagawa committed Dec 18, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/Plack/Middleware/Lint.pm
@@ -164,7 +164,7 @@ sub validate_res {
# print, so there's no need to give warnings about it.
sub _has_wide_char {
my $str = shift;
- $str =~ /[^\x00-\xff]/;
+ utf8::is_utf8($str) && $str =~ /[^\x00-\xff]/;
}
1;

0 comments on commit 94cf6bb

Please sign in to comment.