We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 57814d2 commit b1bba2dCopy full SHA for b1bba2d
include/pgvector/sparsevec.hpp
@@ -59,7 +59,7 @@ class SparseVector {
59
}
60
dimensions_ = dimensions;
61
62
- for (auto [i, v] : map) {
+ for (const auto [i, v] : map) {
63
if (i < 0 || i >= dimensions) {
64
throw std::invalid_argument("sparsevec index out of bounds");
65
@@ -71,7 +71,7 @@ class SparseVector {
71
std::sort(indices_.begin(), indices_.end());
72
73
values_.reserve(indices_.size());
74
- for (auto i : indices_) {
+ for (const auto i : indices_) {
75
values_.push_back(map.at(i));
76
77
0 commit comments