diff --git a/.clang-format b/.clang-format index 2593ef5..a89bbfb 100644 --- a/.clang-format +++ b/.clang-format @@ -1 +1 @@ -BasedOnStyle: Google \ No newline at end of file +BasedOnStyle : Google \ No newline at end of file diff --git a/src/sqlite_functions.cpp b/src/sqlite_functions.cpp index 0d3c167..0a9f3de 100644 --- a/src/sqlite_functions.cpp +++ b/src/sqlite_functions.cpp @@ -1,4 +1,5 @@ #include "sqlite_functions.h" + #include #include @@ -160,7 +161,8 @@ void VectorToMsgPack(sqlite3_context *ctx, int argc, sqlite3_value **argv) { } if (sqlite3_value_type(argv[0]) != SQLITE_BLOB) { - sqlite3_result_error(ctx, "vector_to_msgpack expects vector of type blob", -1); + sqlite3_result_error(ctx, "vector_to_msgpack expects vector of type blob", + -1); return; } @@ -168,10 +170,12 @@ void VectorToMsgPack(sqlite3_context *ctx, int argc, sqlite3_value **argv) { reinterpret_cast(sqlite3_value_blob(argv[0])), sqlite3_value_bytes(argv[0])); - // todo: avoid copying by not constructing a new vector. Because we only need read-only access here. + // todo: avoid copying by not constructing a new vector. Because we only need + // read-only access here. auto vector = sqlite_vector::Vector::FromBlob(vector_blob); if (!vector.ok()) { - std::string err = absl::StrFormat("Failed to parse vector due to: %s", vector.status().message()); + std::string err = absl::StrFormat("Failed to parse vector due to: %s", + vector.status().message()); sqlite3_result_error(ctx, err.c_str(), err.length()); return; } @@ -190,7 +194,8 @@ void VectorToJson(sqlite3_context *ctx, int argc, sqlite3_value **argv) { } if (sqlite3_value_type(argv[0]) != SQLITE_BLOB) { - sqlite3_result_error(ctx, "vector_to_msgpack expects vector of type blob", -1); + sqlite3_result_error(ctx, "vector_to_msgpack expects vector of type blob", + -1); return; } @@ -198,10 +203,12 @@ void VectorToJson(sqlite3_context *ctx, int argc, sqlite3_value **argv) { reinterpret_cast(sqlite3_value_blob(argv[0])), sqlite3_value_bytes(argv[0])); - // todo: avoid copying by not constructing a new vector. Because we only need read-only access here. + // todo: avoid copying by not constructing a new vector. Because we only need + // read-only access here. auto vector = sqlite_vector::Vector::FromBlob(vector_blob); if (!vector.ok()) { - std::string err = absl::StrFormat("Failed to parse vector due to: %s", vector.status().message()); + std::string err = absl::StrFormat("Failed to parse vector due to: %s", + vector.status().message()); sqlite3_result_error(ctx, err.c_str(), err.length()); return; } diff --git a/src/virtual_table.cpp b/src/virtual_table.cpp index 24db149..a0992ad 100644 --- a/src/virtual_table.cpp +++ b/src/virtual_table.cpp @@ -285,7 +285,8 @@ int VirtualTable::Filter(sqlite3_vtab_cursor* pCur, int idxNum, query_vector.dim(), vtab->dimension()); return SQLITE_ERROR; } else { - cursor->query_vector = std::move(vtab->space_.normalize ? query_vector.Normalize() : query_vector); + cursor->query_vector = std::move( + vtab->space_.normalize ? query_vector.Normalize() : query_vector); auto knn = vtab->index_->searchKnnCloserFirst( cursor->query_vector.data().data(), k);