From de7d733d27c13c482f06b23a5770f0d7657cb04b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 10 Feb 2012 15:27:01 +0200 Subject: Don't allocate unnecessary entries in container truncation array --- odb/sqlite/container-statements.hxx | 10 ++-------- odb/sqlite/container-statements.txx | 11 +++++------ 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/odb/sqlite/container-statements.hxx b/odb/sqlite/container-statements.hxx index bd4ea24..80011d9 100644 --- a/odb/sqlite/container-statements.hxx +++ b/odb/sqlite/container-statements.hxx @@ -149,12 +149,6 @@ namespace odb return data_image_binding_; } - bool* - data_image_truncated () - { - return data_image_truncated_; - } - binding& select_image_binding () { @@ -239,7 +233,6 @@ namespace odb std::size_t data_id_binding_version_; binding data_image_binding_; - bool* data_image_truncated_; // Skips the id from data_image_binding. // @@ -274,7 +267,8 @@ namespace odb private: bind cond_image_bind_[traits::cond_column_count]; bind data_image_bind_[traits::data_column_count]; - bool data_image_truncated_array_[traits::data_column_count]; + bool select_image_truncated_array_[traits::data_column_count- + traits::id_column_count]; }; } } diff --git a/odb/sqlite/container-statements.txx b/odb/sqlite/container-statements.txx index b6fc52e..a4dd6f4 100644 --- a/odb/sqlite/container-statements.txx +++ b/odb/sqlite/container-statements.txx @@ -39,9 +39,7 @@ namespace odb container_statements_impl (connection_type& conn) : base (conn) { - this->data_image_truncated_ = data_image_truncated_array_; - this->select_image_truncated_ = data_image_truncated_array_ + - traits::id_column_count; + this->select_image_truncated_ = select_image_truncated_array_; this->cond_image_binding_.bind = cond_image_bind_; this->cond_image_binding_.count = traits::cond_column_count; @@ -56,12 +54,13 @@ namespace odb std::memset (cond_image_bind_, 0, sizeof (cond_image_bind_)); std::memset (data_image_bind_, 0, sizeof (data_image_bind_)); - std::memset (data_image_truncated_array_, + std::memset (select_image_truncated_array_, 0, - sizeof (data_image_truncated_array_)); + sizeof (select_image_truncated_array_)); for (std::size_t i (0); i < traits::data_column_count; ++i) - data_image_bind_[i].truncated = data_image_truncated_array_ + i; + data_image_bind_[i + traits::id_column_count].truncated = + select_image_truncated_array_ + i; this->insert_one_text_ = traits::insert_one_statement; this->select_all_text_ = traits::select_all_statement; -- cgit v1.1