Index: libraries.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/libraries/libraries.module,v
retrieving revision 1.16
diff -u -p -r1.16 libraries.module
--- libraries.module	15 Dec 2010 21:09:52 -0000	1.16
+++ libraries.module	12 Jan 2011 10:35:03 -0000
@@ -359,25 +359,31 @@ function libraries_detect_library(&$libr
  *   The name of the variant to load.
  */
 function libraries_load($name, $variant = NULL) {
-  $library = libraries_info($name);
-  libraries_detect_library($library);
+  $loaded_libraries = &drupal_static(__FUNCTION__);
 
-  // If the library itself is not installed, do nothing;
-  if (!$library['installed']) {
-    return FALSE;
-  }
+  if (!isset($loaded_libraries[$name])) {
+    $library = libraries_info($name);
+    libraries_detect_library($library);
 
-  // If a variant was specified, override the top-level properties with the
-  // variant properties.
-  if (!empty($variant) && !empty($library['variants'][$variant])) {
-    // If the variant is not installed, do nothing.
-    if (!$library['variants'][$variant]['installed']) {
+    // If the library itself is not installed, do nothing;
+    if (!$library['installed']) {
       return FALSE;
     }
-    $library = array_merge($library, $library['variants'][$variant]);
+
+    // If a variant was specified, override the top-level properties with the
+    // variant properties.
+    if (!empty($variant) && !empty($library['variants'][$variant])) {
+      // If the variant is not installed, do nothing.
+      if (!$library['variants'][$variant]['installed']) {
+        return FALSE;
+      }
+      $library = array_merge($library, $library['variants'][$variant]);
+    }
+
+    $loaded_libraries[$name] = libraries_load_files($library, $variant);
   }
 
-  return libraries_load_files($library, $variant);
+  return $loaded_libraries[$name];
 }
 
 /**
