[Bps-public-commit] r14487 - in Data-Plist: .

kyoki at bestpractical.com kyoki at bestpractical.com
Thu Jul 24 17:18:52 EDT 2008


Author: kyoki
Date: Thu Jul 24 17:18:52 2008
New Revision: 14487

Modified:
   Data-Plist/   (props changed)
   Data-Plist/lib/Data/Plist/BinaryWriter.pm

Log:
 r30013 at nyx:  kyoki | 2008-07-24 17:18:50 -0400
 removed some duplicate code


Modified: Data-Plist/lib/Data/Plist/BinaryWriter.pm
==============================================================================
--- Data-Plist/lib/Data/Plist/BinaryWriter.pm	(original)
+++ Data-Plist/lib/Data/Plist/BinaryWriter.pm	Thu Jul 24 17:18:52 2008
@@ -297,8 +297,11 @@
 
 sub write_real {
     my $self    = shift;
-    my ($float) = @_;
-    my $type    = $self->make_type( "2", 3 );
+    my ($float, $type) = @_;
+    unless ( defined $type ) {
+        $type = "2";
+    }
+    my $type    = $self->make_type( $type, 3 );
     my $obj     = $type . reverse( pack( "d", $float ) );
     return $self->binary_write($obj);
 }
@@ -314,9 +317,7 @@
 sub write_date {
     my $self   = shift;
     my ($date) = @_;
-    my $type   = $self->make_type( "3", 3 );
-    my $obj    = $type . reverse( pack( "d", $date ) );
-    return $self->binary_write($obj);
+    return $self->write_real($date, "3");
 }
 
 =head2 write_null $null



More information about the Bps-public-commit mailing list