Browse Source

Changed cache description string parsing

master
Michael Uleysky 3 months ago
parent
commit
6180648ac5
  1. 13
      include/cache.h

13
include/cache.h

@ -375,15 +375,11 @@ class PostgreSQLCache: public GenericCache
inline GenericCache* CreateCache(const MString& cachedesc) inline GenericCache* CreateCache(const MString& cachedesc)
{ {
auto i = cachedesc.GetPos(':'); auto i = cachedesc.GetPos(':');
if(i == 0) auto name = i == 0 ? cachedesc : cachedesc.SubStr(1, i - 1);
{ auto par = i == 0 ? "" : cachedesc.SubStr(i + 1, cachedesc.Len() - i);
if(cachedesc == "no") return new FakeCache;
return nullptr;
}
auto name = cachedesc.SubStr(1, i - 1); if(name == "no") return new FakeCache;
auto par = cachedesc.SubStr(i + 1, cachedesc.Len() - i);
if(name == "sqlite") if(name == "sqlite")
{ {
@ -392,6 +388,7 @@ inline GenericCache* CreateCache(const MString& cachedesc)
if(*ret) return ret; if(*ret) return ret;
delete ret; delete ret;
} }
if(name == "postgre" || name == "postgres" || name == "postgresql") if(name == "postgre" || name == "postgres" || name == "postgresql")
{ {
auto ret = new PostgreSQLCache; auto ret = new PostgreSQLCache;

Loading…
Cancel
Save