--- location.module	2010-08-30 11:12:43.000000000 +0200
+++ location.module	2010-08-30 11:10:49.000000000 +0200
@@ -865,47 +865,56 @@ function location_save_locations(&$locat
  * @param $lid Location ID to load.
  * @return A location array.
  */
-function location_load_location($lid) {
-  $location = db_fetch_array(db_query('SELECT * FROM {location} WHERE lid = %d', $lid));
-  // @@@ Just thought of this, but I am not certain it is a good idea...
-  if (empty($location)) {
-    $location = array('lid' => $lid);
-  }
-  if (isset($location['source']) && $location['source'] == LOCATION_LATLON_USER_SUBMITTED) {
-    // Set up location chooser or lat/lon fields from the stored location.
-    $location['locpick'] = array(
-      'user_latitude' => $location['latitude'],
-      'user_longitude' => $location['longitude'],
-    );
+function location_load_location($lid, $reset = false) {
+  static $cache;
+
+  if(!is_array($cache) || $reset) {
+    $cache = array();
   }
 
-  // JIT Geocoding
-  // Geocodes during load, useful with bulk imports.
-  if (isset($location['source']) && $location['source'] == LOCATION_LATLON_JIT_GEOCODING) {
-    if (variable_get('location_jit_geocoding', FALSE)) {
-      _location_geo_logic($location, array('street' => 1), array());
-      db_query("UPDATE {location} SET latitude = '%f', longitude = '%f', source = %d WHERE lid = %d",
-      $location['latitude'],
-      $location['longitude'],
-      $location['source'],
-      $location['lid']);
+  if(!isset($cache[$lid])) {
+    $location = db_fetch_array(db_query('SELECT * FROM {location} WHERE lid = %d', $lid));
+    // @@@ Just thought of this, but I am not certain it is a good idea...
+    if (empty($location)) {
+      $location = array('lid' => $lid);
+    }
+    if (isset($location['source']) && $location['source'] == LOCATION_LATLON_USER_SUBMITTED) {
+      // Set up location chooser or lat/lon fields from the stored location.
+      $location['locpick'] = array(
+        'user_latitude' => $location['latitude'],
+        'user_longitude' => $location['longitude'],
+      );
     }
-  }
 
-  $location['province_name'] = '';
-  $location['country_name'] = '';
+    // JIT Geocoding
+    // Geocodes during load, useful with bulk imports.
+    if (isset($location['source']) && $location['source'] == LOCATION_LATLON_JIT_GEOCODING) {
+      if (variable_get('location_jit_geocoding', FALSE)) {
+        _location_geo_logic($location, array('street' => 1), array());
+        db_query("UPDATE {location} SET latitude = '%f', longitude = '%f', source = %d WHERE lid = %d",
+        $location['latitude'],
+        $location['longitude'],
+        $location['source'],
+        $location['lid']);
+      }
+    }
+
+    $location['province_name'] = '';
+    $location['country_name'] = '';
 
-  if (!empty($location['country'])) {
-    $location['country_name'] = location_country_name($location['country']);
+    if (!empty($location['country'])) {
+      $location['country_name'] = location_country_name($location['country']);
 
-    if (!empty($location['province'])) {
-      $location['province_name'] = location_province_name($location['country'], $location['province']);
+      if (!empty($location['province'])) {
+        $location['province_name'] = location_province_name($location['country'], $location['province']);
+      }
     }
-  }
 
-  $location = array_merge($location, location_invoke_locationapi($location, 'load', $lid));
+    $location = array_merge($location, location_invoke_locationapi($location, 'load', $lid));
 
-  return $location;
+    $cache[$lid] = $location;
+  }
+  return $cache[$lid];
 }
 
 /**
