Skip to content

Commit 7106718

Browse files
committed
Improved code [skip ci]
1 parent ccb4ab9 commit 7106718

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

include/pgvector/halfvec.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ namespace pgvector {
1717
class HalfVector {
1818
public:
1919
/// Creates a half vector from a `std::vector<float>`.
20-
explicit HalfVector(const std::vector<float>& value) {
21-
value_ = value;
22-
}
20+
explicit HalfVector(const std::vector<float>& value) : value_{value} {}
2321

2422
/// Creates a half vector from a `std::vector<float>`.
2523
explicit HalfVector(std::vector<float>&& value) {

include/pgvector/vector.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ namespace pgvector {
1717
class Vector {
1818
public:
1919
/// Creates a vector from a `std::vector<float>`.
20-
explicit Vector(const std::vector<float>& value) {
21-
value_ = value;
22-
}
20+
explicit Vector(const std::vector<float>& value) : value_{value} {}
2321

2422
/// Creates a vector from a `std::vector<float>`.
2523
explicit Vector(std::vector<float>&& value) {

0 commit comments

Comments
 (0)