Author: wyoung
Date: Tue Feb 20 13:57:33 2007
New Revision: 1424
URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1424&view=rev
Log:
Minor speed optimizations in the Row() ctor that copies data from a
MYSQL_ROW structure, and in Row::size(). Patch by Korolyov Ilya
<[EMAIL PROTECTED]>.
Modified:
trunk/lib/row.cpp
Modified: trunk/lib/row.cpp
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/row.cpp?rev=1424&r1=1423&r2=1424&view=diff
==============================================================================
--- trunk/lib/row.cpp (original)
+++ trunk/lib/row.cpp Tue Feb 20 13:57:33 2007
@@ -44,10 +44,13 @@
return;
}
}
+
data_.clear();
is_nulls_.clear();
initialized_ = true;
- for (unsigned int i = 0; i < size(); i++) {
+
+ size_type num_fields = size();
+ for (size_type i = 0; i < num_fields; ++i) {
data_.insert(data_.end(),
(d[i] ? std::string(d[i], jj[i]) :
std::string("NULL")));
is_nulls_.insert(is_nulls_.end(), d[i] ? false : true);
@@ -65,7 +68,7 @@
Row::size_type Row::size() const
{
- return res_->num_fields();
+ return data_.size();
}
const ColData Row::at(size_type i) const
_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits