fix(MainDb): use references when possible

This commit is contained in:
Ronan Abhamon 2017-11-24 14:55:39 +01:00
parent 759ecda219
commit dcef9e4f97

View file

@ -143,11 +143,11 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
long long messageContentId = q->getLastInsertId();
if (content.getContentType().isFile()) {
const FileContent *fileContent = (const FileContent *)&content;
const FileContent &fileContent = static_cast<const FileContent &>(content);
*session << "INSERT INTO chat_message_file_content (chat_message_content_id, name, size, path) VALUES "
" (:contentId, :name, :size, :path)",
soci::use(messageContentId), soci::use(fileContent->getFileName()),
soci::use(fileContent->getFileSize()), soci::use(fileContent->getFilePath());
soci::use(messageContentId), soci::use(fileContent.getFileName()),
soci::use(fileContent.getFileSize()), soci::use(fileContent.getFilePath());
}
for (const auto &appData : content.getAppDataMap())