aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/lib/db
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-01-30 10:05:04 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-01-30 12:27:47 -0800
commit7149a2e2e2f549035f23e21224ee41afe8df3876 (patch)
tree4fab32a87362e9708d07f388154a10ccb0c7800b /tensorflow/core/lib/db
parent88eb6c61ef7659c2b5bb1ec6586c7d3cca5e4e9c (diff)
Cleanup: Ran clang-format on files in tensorflow/core/.../*.{cc,h}.
PiperOrigin-RevId: 183848459
Diffstat (limited to 'tensorflow/core/lib/db')
-rw-r--r--tensorflow/core/lib/db/sqlite.h23
-rw-r--r--tensorflow/core/lib/db/sqlite_test.cc8
2 files changed, 14 insertions, 17 deletions
diff --git a/tensorflow/core/lib/db/sqlite.h b/tensorflow/core/lib/db/sqlite.h
index 0faa458f1d..efe97f78d2 100644
--- a/tensorflow/core/lib/db/sqlite.h
+++ b/tensorflow/core/lib/db/sqlite.h
@@ -18,12 +18,12 @@ limitations under the License.
#include <mutex>
#include "sqlite3.h"
+#include "tensorflow/core/lib/core/refcount.h"
#include "tensorflow/core/lib/core/status.h"
#include "tensorflow/core/lib/core/stringpiece.h"
#include "tensorflow/core/platform/macros.h"
#include "tensorflow/core/platform/thread_annotations.h"
#include "tensorflow/core/platform/types.h"
-#include "tensorflow/core/lib/core/refcount.h"
/// TensorFlow SQLite Veneer
///
@@ -121,10 +121,7 @@ class LOCKABLE Sqlite : public core::RefCounted {
Sqlite(sqlite3* db, sqlite3_stmt* begin, sqlite3_stmt* commit,
sqlite3_stmt* rollback) noexcept
- : db_(db),
- begin_(begin),
- commit_(commit),
- rollback_(rollback) {}
+ : db_(db), begin_(begin), commit_(commit), rollback_(rollback) {}
sqlite3* const db_;
sqlite3_stmt* const begin_;
@@ -233,7 +230,8 @@ class SqliteStatement {
/// freed until this statement is Reset() or finalized.
void BindText(int parameter, const StringPiece& text) {
Update(sqlite3_bind_text64(stmt_, parameter, text.data(), text.size(),
- SQLITE_TRANSIENT, SQLITE_UTF8), parameter);
+ SQLITE_TRANSIENT, SQLITE_UTF8),
+ parameter);
size_ += text.size();
}
void BindText(const char* parameter, const StringPiece& text) {
@@ -241,7 +239,8 @@ class SqliteStatement {
}
void BindTextUnsafe(int parameter, const StringPiece& text) {
Update(sqlite3_bind_text64(stmt_, parameter, text.data(), text.size(),
- SQLITE_STATIC, SQLITE_UTF8), parameter);
+ SQLITE_STATIC, SQLITE_UTF8),
+ parameter);
size_ += text.size();
}
void BindTextUnsafe(const char* parameter, const StringPiece& text) {
@@ -254,7 +253,8 @@ class SqliteStatement {
/// freed until this statement is Reset() or finalized.
void BindBlob(int parameter, const StringPiece& blob) {
Update(sqlite3_bind_blob64(stmt_, parameter, blob.data(), blob.size(),
- SQLITE_TRANSIENT), parameter);
+ SQLITE_TRANSIENT),
+ parameter);
size_ += blob.size();
}
void BindBlob(const char* parameter, const StringPiece& blob) {
@@ -262,7 +262,8 @@ class SqliteStatement {
}
void BindBlobUnsafe(int parameter, const StringPiece& blob) {
Update(sqlite3_bind_blob64(stmt_, parameter, blob.data(), blob.size(),
- SQLITE_STATIC), parameter);
+ SQLITE_STATIC),
+ parameter);
size_ += blob.size();
}
void BindBlobUnsafe(const char* parameter, const StringPiece& text) {
@@ -320,9 +321,7 @@ class SqliteStatement {
/// \brief Move constructor, after which <other> is reset to empty.
SqliteStatement(SqliteStatement&& other) noexcept
- : db_(other.db_),
- stmt_(other.stmt_),
- bind_error_(other.bind_error_) {
+ : db_(other.db_), stmt_(other.stmt_), bind_error_(other.bind_error_) {
other.db_ = nullptr;
other.stmt_ = nullptr;
other.bind_error_ = SQLITE_OK;
diff --git a/tensorflow/core/lib/db/sqlite_test.cc b/tensorflow/core/lib/db/sqlite_test.cc
index c9c76ea5f2..1e88323d01 100644
--- a/tensorflow/core/lib/db/sqlite_test.cc
+++ b/tensorflow/core/lib/db/sqlite_test.cc
@@ -33,9 +33,7 @@ class SqliteTest : public ::testing::Test {
db_->PrepareOrDie("CREATE TABLE T (a BLOB, b BLOB)").StepAndResetOrDie();
}
- void TearDown() override {
- db_->Unref();
- }
+ void TearDown() override { db_->Unref(); }
Sqlite* db_;
bool is_done_;
@@ -213,7 +211,7 @@ TEST_F(SqliteTest, BindFailed) {
Status s = stmt.StepOnce();
EXPECT_NE(string::npos,
s.error_message().find("INSERT INTO T (a) VALUES (123)"))
- << s.error_message();
+ << s.error_message();
}
TEST_F(SqliteTest, SnappyExtension) {
@@ -226,7 +224,7 @@ TEST_F(SqliteTest, SnappyBinaryCompatibility) {
EXPECT_EQ(
"today is the end of the republic",
db_->PrepareOrDie("SELECT UNSNAP(X'03207C746F6461792069732074686520656E64"
- "206F66207468652072657075626C6963')")
+ "206F66207468652072657075626C6963')")
.StepOnceOrDie()
.ColumnString(0));
}