[Opensrf-commits] r1667 - branches/rel_1_0/src/perl/lib/OpenSRF/Utils (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Feb 17 13:05:09 EST 2009


Author: erickson
Date: 2009-02-17 13:05:06 -0500 (Tue, 17 Feb 2009)
New Revision: 1667

Modified:
   branches/rel_1_0/src/perl/lib/OpenSRF/Utils/JSON.pm
Log:
backport 1666

Modified: branches/rel_1_0/src/perl/lib/OpenSRF/Utils/JSON.pm
===================================================================
--- branches/rel_1_0/src/perl/lib/OpenSRF/Utils/JSON.pm	2009-02-17 18:04:39 UTC (rev 1666)
+++ branches/rel_1_0/src/perl/lib/OpenSRF/Utils/JSON.pm	2009-02-17 18:05:06 UTC (rev 1667)
@@ -80,11 +80,14 @@
 			return undef;
 		}
         for my $k (keys %$obj) {
-            $obj->{$k} = (ref($obj->{$k}) eq 'JSON::XS::Boolean') ? 
-                $obj->{$k} : $class->JSONObject2Perl($obj->{$k});
+            $obj->{$k} = $class->JSONObject2Perl($obj->{$k}) 
+                unless ref($obj->{$k}) eq 'JSON::XS::Boolean';
         }
 	} elsif( $ref eq 'ARRAY' ) {
-		$obj->[$_] = $class->JSONObject2Perl($obj->[$_]) for(0..scalar(@$obj) - 1);
+		for my $i (0..scalar(@$obj) - 1) {
+		    $obj->[$i] = $class->JSONObject2Perl($obj->[$i]) 
+                unless ref($obj->[$i]) eq 'JSON::XS::Boolean';
+        }
 	}
 	return $obj;
 }



More information about the opensrf-commits mailing list