Skip to content

Commit e35f71e

Browse files
committed
Use string_traits like other methods
1 parent 74c0767 commit e35f71e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/pgvector/pqxx.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ template <> struct string_traits<pgvector::SparseVector> {
130130
throw conversion_error("Malformed sparsevec literal");
131131
}
132132

133-
int dimensions = pqxx::from_string<int>(text.substr(n + 2));
133+
int dimensions = string_traits<int>::from_string(text.substr(n + 2));
134134
if (dimensions < 0) {
135135
throw conversion_error("Dimensions cannot be negative");
136136
}
@@ -149,8 +149,8 @@ template <> struct string_traits<pgvector::SparseVector> {
149149
throw conversion_error("Malformed sparsevec literal");
150150
}
151151

152-
int index = pqxx::from_string<int>(substr.substr(0, ne));
153-
float value = pqxx::from_string<float>(substr.substr(ne + 1));
152+
int index = string_traits<int>::from_string(substr.substr(0, ne));
153+
float value = string_traits<float>::from_string(substr.substr(ne + 1));
154154

155155
if (index < 1) {
156156
throw conversion_error("Index out of bounds");

0 commit comments

Comments
 (0)