From 0dbe66f3950af0de939f19e59d9459aba8fe2347 Mon Sep 17 00:00:00 2001 From: gregor herrmann Date: Fri, 20 Jul 2018 20:40:05 +0200 Subject: New upstream version 1.836 --- lib/MCE/Flow.pm | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) (limited to 'lib/MCE/Flow.pm') diff --git a/lib/MCE/Flow.pm b/lib/MCE/Flow.pm index c0f1dcd..e6a5ea1 100644 --- a/lib/MCE/Flow.pm +++ b/lib/MCE/Flow.pm @@ -11,7 +11,7 @@ use warnings; no warnings qw( threads recursion uninitialized ); -our $VERSION = '1.835'; +our $VERSION = '1.836'; ## no critic (BuiltinFunctions::ProhibitStringyEval) ## no critic (Subroutines::ProhibitSubroutinePrototypes) @@ -77,10 +77,10 @@ sub import { _croak("Error: ($_argument) invalid module option"); } - $_p->{MAX_WORKERS} = MCE::Util::_parse_max_workers($_p->{MAX_WORKERS}); + $_p->{MAX_WORKERS} = MCE::_parse_max_workers($_p->{MAX_WORKERS}); - _validate_number($_p->{MAX_WORKERS}, 'MAX_WORKERS'); - _validate_number($_p->{CHUNK_SIZE}, 'CHUNK_SIZE') + MCE::_validate_number($_p->{MAX_WORKERS}, 'MAX_WORKERS', $_tag); + MCE::_validate_number($_p->{CHUNK_SIZE}, 'CHUNK_SIZE', $_tag) unless ($_p->{CHUNK_SIZE} eq 'auto'); return; @@ -316,7 +316,7 @@ sub run (@) { } if (defined (my $_p = $_params->{$_pid})) { - $_max_workers = MCE::Util::_parse_max_workers($_p->{max_workers}) + $_max_workers = MCE::_parse_max_workers($_p->{max_workers}) if (exists $_p->{max_workers} && ref $_p->{max_workers} ne 'ARRAY'); delete $_p->{sequence} if (defined $_input_data || scalar @_); @@ -328,7 +328,7 @@ sub run (@) { $_max_workers = int($_max_workers / @_code + 0.5) + 1; } - my $_chunk_size = MCE::Util::_parse_chunk_size( + my $_chunk_size = MCE::_parse_chunk_size( $_def->{$_pkg}{CHUNK_SIZE}, $_max_workers, $_params->{$_pid}, $_input_data, scalar @_ ); @@ -464,21 +464,6 @@ sub _gen_user_tasks { return; } -sub _validate_number { - - my ($_n, $_key) = @_; - - _croak("$_tag: ($_key) is not valid") if (!defined $_n); - - $_n =~ s/K\z//i; $_n =~ s/M\z//i; - - if (!looks_like_number($_n) || int($_n) != $_n || $_n < 1) { - _croak("$_tag: ($_key) is not valid"); - } - - return; -} - 1; __END__ @@ -495,7 +480,7 @@ MCE::Flow - Parallel flow model for building creative applications =head1 VERSION -This document describes MCE::Flow version 1.835 +This document describes MCE::Flow version 1.836 =head1 DESCRIPTION -- cgit v1.2.3