Stop lazy-requiring B and Storable in internal functions
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / _Util.pm
index 053e0a5..e2a9bbf 100644 (file)
@@ -53,7 +53,9 @@ BEGIN {
 # Carp::Skip to the rescue soon
 use DBIx::Class::Carp '^DBIx::Class|^DBICTest';
 
+use B ();
 use Carp 'croak';
+use Storable 'nfreeze';
 use Scalar::Util qw(weaken blessed reftype);
 use List::Util qw(first);
 
@@ -114,16 +116,14 @@ sub refdesc ($) {
 sub refcount ($) {
   croak "Expecting a reference" if ! length ref $_[0];
 
-  require B;
   # No tempvars - must operate on $_[0], otherwise the pad
   # will count as an extra ref
   B::svref_2object($_[0])->REFCNT;
 }
 
 sub serialize ($) {
-  require Storable;
   local $Storable::canonical = 1;
-  Storable::nfreeze($_[0]);
+  nfreeze($_[0]);
 }
 
 sub is_exception ($) {