minor performance improvement, better workaround for clang issue with handle property

This commit is contained in:
Guenter Obiltschnig 2014-04-18 21:27:46 +02:00
parent 8d14b92b65
commit 835845422c
3 changed files with 3 additions and 6 deletions

View File

@ -223,10 +223,7 @@ private:
inline sqlite3* Utility::dbHandle(const Session& session)
{
#ifdef POCO_COMPILER_CLANG
sqlite3* p = 0; Any a = p; // ??? clang fails to AnyCast without these ???
#endif
return AnyCast<sqlite3*>(session.getProperty("handle"));
return reinterpret_cast<sqlite3*>(AnyCast<void*>(session.getProperty("handle")));
}

View File

@ -118,7 +118,7 @@ bool Extractor::extract(std::size_t pos, std::string& val)
if (!pBuf)
val.clear();
else
val = std::string(pBuf);
val.assign(pBuf);
return true;
}

View File

@ -67,7 +67,7 @@ SessionImpl::SessionImpl(const std::string& fileName, std::size_t loginTimeout):
{
open();
setConnectionTimeout(CONNECTION_TIMEOUT_DEFAULT);
setProperty("handle", _pDB);
setProperty("handle", static_cast<void*>(_pDB));
addFeature("autoCommit",
&SessionImpl::autoCommit,
&SessionImpl::isAutoCommit);