Permalink
Browse files

Small optimization

  • Loading branch information...
1 parent 508487a commit 1d7d4dfee064a1ad337bae891e4039575577378b @mariano committed Oct 3, 2011
Showing with 6 additions and 7 deletions.
  1. +6 −7 src/result.cc
View
@@ -217,19 +217,18 @@ char** node_db_oracle::Result::row(unsigned long* rowColumnLengths) throw(node_d
std::string string;
if (this->columns[c]->getType() == Column::DATETIME) {
oracle::occi::Date date = this->resultSet->getDate(c + 1);
- if (!date.isNull())
- string = date.toText("YYYY-MM-DD HH:II:SS");
+ if (date.isNull()) {
+ rowColumnLengths[c] = 0;
+ row[c] = NULL;
+ continue;
}
+
+ string = date.toText("YYYY-MM-DD HH:II:SS");
} else {
string = this->resultSet->getString(c + 1);
}
rowColumnLengths[c] = string.length();
- if (rowColumnLengths[c] == 0) {
- row[c] = NULL;
- continue;
- }
-
row[c] = new char[rowColumnLengths[c]];
if (row[c] == NULL) {
throw node_db::Exception("Could not allocate buffer for row column");

0 comments on commit 1d7d4df

Please sign in to comment.