mirror of
https://github.com/rbock/sqlpp11.git
synced 2024-11-15 20:31:16 +08:00
Use assign to reduce number of copies
This commit is contained in:
parent
33b69279d7
commit
862205d1bf
@ -47,9 +47,9 @@ namespace sqlpp
|
||||
size_t len{};
|
||||
target._bind_text_result(index, &text, &len);
|
||||
if (text)
|
||||
this->_value = {text, len};
|
||||
this->_value.assign(text, len);
|
||||
else
|
||||
this->value = {};
|
||||
this->_value.assign("", 0);
|
||||
this->_is_null = (text == nullptr);
|
||||
}
|
||||
|
||||
@ -60,9 +60,9 @@ namespace sqlpp
|
||||
size_t len{};
|
||||
target._post_bind_text_result(index, &text, &len);
|
||||
if (text)
|
||||
this->_value = {text, len};
|
||||
this->_value.assign(text, len);
|
||||
else
|
||||
this->value = {};
|
||||
this->_value.assign("", 0);
|
||||
this->_is_null = (text == nullptr);
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user