]> git.vpit.fr Git - perl/modules/Regexp-Wildcards.git/blobdiff - lib/Regexp/Wildcards.pm
Be less chatty for handling the type in ->convert
[perl/modules/Regexp-Wildcards.git] / lib / Regexp / Wildcards.pm
index 6444f9698645054fd9ebbf69d1f44797d838dc0d..b70b593edaae910d4adacef7773bce5b5bd6160c 100644 (file)
@@ -297,6 +297,8 @@ No argument means C<< set => [ ] >>.
     $rw->do(rem => 'jokers');           # Specifying both 'sql' and 'jokers' is useless.
     $rw->do();                          # Translate nothing.
 
+The C<do> method returns the L<Regexp::Wildcards> object.
+
 =head2 C<type $type>
 
 Notifies to convert the metacharacters that corresponds to the predefined type C<$type>.
@@ -402,12 +404,7 @@ It successively escapes all unprotected regexp special characters that doesn't h
 sub convert {
  my ($self, $wc, $type) = @_;
  _check_self $self;
- my $config;
- if (defined $type) {
-  $config = $self->_type($type);
- } else {
-  $config = $self;
- }
+ my $config = (defined $type) ? $self->_type($type) : $self;
  return unless defined $wc;
  my $do = $config->{do};
  my $e  = $config->{escape};