Author: wyoung
Date: Wed Nov 28 03:37:31 2007
New Revision: 1897
URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1897&view=rev
Log:
Minor style tweak to the way we're initializing Row objects. If the
MYSQL_ROW object was NULL but ResUse* wasn't, it'd be half-initialized.
Now it's all or nothing.
Modified:
trunk/lib/row.cpp
Modified: trunk/lib/row.cpp
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/row.cpp?rev=1897&r1=1896&r2=1897&view=diff
==============================================================================
--- trunk/lib/row.cpp (original)
+++ trunk/lib/row.cpp Wed Nov 28 03:37:31 2007
@@ -34,13 +34,12 @@
bool throw_exceptions) :
OptionalExceptions(throw_exceptions),
initialized_(false),
-size_(r ? r->num_fields() : 0)
+size_(0)
{
- if (r) {
+ if (d && r) {
+ size_ = r->num_fields();
field_names_ = r->field_names();
- }
-
- if (d && r) {
+
data_.reserve(size_);
for (size_type i = 0; i < size_; ++i) {
bool is_null = d[i] == 0;
_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits