From: Fuji, Goro Date: Sat, 25 Sep 2010 14:41:08 +0000 (+0900) Subject: Tweaks X-Git-Tag: 0.74~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=51b0597dcccaadf7fe2a6ff3ab9bd54c39e8bf47;p=gitmo%2FMouse.git Tweaks --- diff --git a/lib/Mouse/Meta/Method/Constructor.pm b/lib/Mouse/Meta/Method/Constructor.pm index da6e196..29e1ba7 100644 --- a/lib/Mouse/Meta/Method/Constructor.pm +++ b/lib/Mouse/Meta/Method/Constructor.pm @@ -13,7 +13,9 @@ sub _generate_constructor { my $buildall = $class->_generate_BUILDALL($metaclass); my $buildargs = $class->_generate_BUILDARGS($metaclass); - my $initializer = $class->_generate_initialize_object($metaclass); + my $initializer = $metaclass->{_initialize_object} ||= do { + $class->_generate_initialize_object($metaclass); + }; my $source = sprintf(<<'EOT', __LINE__, __FILE__, $metaclass->name, $buildargs, $buildall); #line %d %s package %s;