Kaydet (Commit) d9799032 authored tarafından Norbert Thiebaud's avatar Norbert Thiebaud

odbc driver: let's not allocate the buffer twice for nothing

Change-Id: If5db845c856a9fb3adf8c4fcb883607e1cb9446e
üst 715ecfe3
......@@ -346,16 +346,15 @@ void OPreparedStatement::setParameter(const sal_Int32 parameterIndex, const sal_
}
else
{
std::vector<sal_uInt32> u;
pData = allocBindBuf(parameterIndex, _sData.getLength() * 4);
sal_uInt32* pCursor = (sal_uInt32*)pData;
nCharLen = 0;
for (sal_Int32 i = 0; i != _sData.getLength();)
{
u.push_back(_sData.iterateCodePoints(&i));
*pCursor++ = _sData.iterateCodePoints(&i);
nCharLen += 1;
}
nCharLen = u.size();
nByteLen = 4 * nCharLen;
pData = allocBindBuf(parameterIndex, nByteLen);
if (!u.empty())
memcpy(pData, &u[0], nByteLen);
}
}
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment