0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-16 04:47:18 +08:00

Use assign to reduce number of copies

This commit is contained in:
rbock 2017-03-12 09:58:04 +01:00
parent 33b69279d7
commit 862205d1bf

View File

@ -47,9 +47,9 @@ namespace sqlpp
size_t len{}; size_t len{};
target._bind_text_result(index, &text, &len); target._bind_text_result(index, &text, &len);
if (text) if (text)
this->_value = {text, len}; this->_value.assign(text, len);
else else
this->value = {}; this->_value.assign("", 0);
this->_is_null = (text == nullptr); this->_is_null = (text == nullptr);
} }
@ -60,9 +60,9 @@ namespace sqlpp
size_t len{}; size_t len{};
target._post_bind_text_result(index, &text, &len); target._post_bind_text_result(index, &text, &len);
if (text) if (text)
this->_value = {text, len}; this->_value.assign(text, len);
else else
this->value = {}; this->_value.assign("", 0);
this->_is_null = (text == nullptr); this->_is_null = (text == nullptr);
} }
}; };