Changeset

3855:b77bb597bcb0

storagemanager: When we have a cached data driver, we are supposed to use it.
author Waqas Hussain <waqas20@gmail.com>
date Sun, 12 Dec 2010 06:15:08 +0500
parents 3854:5a1551d604b1
children 3856:2cb50432bc9a
files core/storagemanager.lua
diffstat 1 files changed, 6 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/core/storagemanager.lua	Sun Dec 12 05:39:24 2010 +0500
+++ b/core/storagemanager.lua	Sun Dec 12 06:15:08 2010 +0500
@@ -44,13 +44,12 @@
 		return;
 	end
 	local driver = stores_available:get(host, driver_name);
-	if not driver then
-		if driver_name ~= "internal" then
-			modulemanager.load(host, "storage_"..driver_name);
-			return stores_available:get(host, driver_name);
-		else
-			return setmetatable({host = host}, default_driver_mt);
-		end
+	if driver then return driver; end
+	if driver_name ~= "internal" then
+		modulemanager.load(host, "storage_"..driver_name);
+		return stores_available:get(host, driver_name);
+	else
+		return setmetatable({host = host}, default_driver_mt);
 	end
 end