[Jifty-commit] r1441 - jifty/trunk/lib/Jifty

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sun Jul 2 21:03:41 EDT 2006


Author: audreyt
Date: Sun Jul  2 21:03:40 2006
New Revision: 1441

Modified:
   jifty/trunk/lib/Jifty/Request.pm

Log:
* Jifty::Request - the "clone" method now does shallow copying
  over at most two level into the Request structure, which means
  that ->arguments can contain CODE references (and other structural
  references) as values now, although those will be shared among
  region children and region parents.

Modified: jifty/trunk/lib/Jifty/Request.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Request.pm	(original)
+++ jifty/trunk/lib/Jifty/Request.pm	Sun Jul  2 21:03:40 2006
@@ -97,7 +97,12 @@
 
 sub clone {
     my $self = shift;
-    return dclone($self);
+    
+    # "Semi-shallow" clone
+    return bless({map {
+        my $val = $self->{$_};
+        $_ => (ref($val) ? { %$val } : $val);
+    } keys %$self}, ref($self));
 }
 
 =head2 fill


More information about the Jifty-commit mailing list