Skip to content

Commit ccb4ab9

Browse files
committed
Improved naming [skip ci]
1 parent 9dacbdf commit ccb4ab9

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

include/pgvector/pqxx.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@ template <> struct string_traits<pgvector::Vector> {
2929
throw conversion_error("Malformed vector literal");
3030
}
3131

32-
std::vector<float> result;
32+
std::vector<float> values;
3333
if (text.size() > 2) {
3434
std::string_view inner = text.substr(1, text.size() - 2);
3535
size_t start = 0;
3636
for (size_t i = 0; i < inner.size(); i++) {
3737
if (inner[i] == ',') {
38-
result.push_back(string_traits<float>::from_string(inner.substr(start, i - start), c));
38+
values.push_back(string_traits<float>::from_string(inner.substr(start, i - start), c));
3939
start = i + 1;
4040
}
4141
}
42-
result.push_back(string_traits<float>::from_string(inner.substr(start), c));
42+
values.push_back(string_traits<float>::from_string(inner.substr(start), c));
4343
}
44-
return pgvector::Vector(std::move(result));
44+
return pgvector::Vector(std::move(values));
4545
}
4646

4747
static std::string_view to_buf(std::span<char> buf, const pgvector::Vector& value, ctx c = {}) {
@@ -93,19 +93,19 @@ template <> struct string_traits<pgvector::HalfVector> {
9393
throw conversion_error("Malformed halfvec literal");
9494
}
9595

96-
std::vector<float> result;
96+
std::vector<float> values;
9797
if (text.size() > 2) {
9898
std::string_view inner = text.substr(1, text.size() - 2);
9999
size_t start = 0;
100100
for (size_t i = 0; i < inner.size(); i++) {
101101
if (inner[i] == ',') {
102-
result.push_back(string_traits<float>::from_string(inner.substr(start, i - start), c));
102+
values.push_back(string_traits<float>::from_string(inner.substr(start, i - start), c));
103103
start = i + 1;
104104
}
105105
}
106-
result.push_back(string_traits<float>::from_string(inner.substr(start), c));
106+
values.push_back(string_traits<float>::from_string(inner.substr(start), c));
107107
}
108-
return pgvector::HalfVector(std::move(result));
108+
return pgvector::HalfVector(std::move(values));
109109
}
110110

111111
static std::string_view to_buf(std::span<char> buf, const pgvector::HalfVector& value, ctx c = {}) {

0 commit comments

Comments
 (0)