@@ -39,92 +39,92 @@ Result<std::shared_ptr<GlobalIndexResult>> UnionGlobalIndexReader::VisitIsNull()
3939
4040Result<std::shared_ptr<GlobalIndexResult>> UnionGlobalIndexReader::VisitEqual (
4141 const Literal& literal) {
42- return Union ([& literal](const std::shared_ptr<GlobalIndexReader>& reader) {
42+ return Union ([literal](const std::shared_ptr<GlobalIndexReader>& reader) {
4343 return reader->VisitEqual (literal);
4444 });
4545}
4646
4747Result<std::shared_ptr<GlobalIndexResult>> UnionGlobalIndexReader::VisitNotEqual (
4848 const Literal& literal) {
49- return Union ([& literal](const std::shared_ptr<GlobalIndexReader>& reader) {
49+ return Union ([literal](const std::shared_ptr<GlobalIndexReader>& reader) {
5050 return reader->VisitNotEqual (literal);
5151 });
5252}
5353
5454Result<std::shared_ptr<GlobalIndexResult>> UnionGlobalIndexReader::VisitLessThan (
5555 const Literal& literal) {
56- return Union ([& literal](const std::shared_ptr<GlobalIndexReader>& reader) {
56+ return Union ([literal](const std::shared_ptr<GlobalIndexReader>& reader) {
5757 return reader->VisitLessThan (literal);
5858 });
5959}
6060
6161Result<std::shared_ptr<GlobalIndexResult>> UnionGlobalIndexReader::VisitLessOrEqual (
6262 const Literal& literal) {
63- return Union ([& literal](const std::shared_ptr<GlobalIndexReader>& reader) {
63+ return Union ([literal](const std::shared_ptr<GlobalIndexReader>& reader) {
6464 return reader->VisitLessOrEqual (literal);
6565 });
6666}
6767
6868Result<std::shared_ptr<GlobalIndexResult>> UnionGlobalIndexReader::VisitGreaterThan (
6969 const Literal& literal) {
70- return Union ([& literal](const std::shared_ptr<GlobalIndexReader>& reader) {
70+ return Union ([literal](const std::shared_ptr<GlobalIndexReader>& reader) {
7171 return reader->VisitGreaterThan (literal);
7272 });
7373}
7474
7575Result<std::shared_ptr<GlobalIndexResult>> UnionGlobalIndexReader::VisitGreaterOrEqual (
7676 const Literal& literal) {
77- return Union ([& literal](const std::shared_ptr<GlobalIndexReader>& reader) {
77+ return Union ([literal](const std::shared_ptr<GlobalIndexReader>& reader) {
7878 return reader->VisitGreaterOrEqual (literal);
7979 });
8080}
8181
8282Result<std::shared_ptr<GlobalIndexResult>> UnionGlobalIndexReader::VisitIn (
8383 const std::vector<Literal>& literals) {
84- return Union ([& literals](const std::shared_ptr<GlobalIndexReader>& reader) {
84+ return Union ([literals](const std::shared_ptr<GlobalIndexReader>& reader) {
8585 return reader->VisitIn (literals);
8686 });
8787}
8888
8989Result<std::shared_ptr<GlobalIndexResult>> UnionGlobalIndexReader::VisitNotIn (
9090 const std::vector<Literal>& literals) {
91- return Union ([& literals](const std::shared_ptr<GlobalIndexReader>& reader) {
91+ return Union ([literals](const std::shared_ptr<GlobalIndexReader>& reader) {
9292 return reader->VisitNotIn (literals);
9393 });
9494}
9595
9696Result<std::shared_ptr<GlobalIndexResult>> UnionGlobalIndexReader::VisitStartsWith (
9797 const Literal& prefix) {
98- return Union ([& prefix](const std::shared_ptr<GlobalIndexReader>& reader) {
98+ return Union ([prefix](const std::shared_ptr<GlobalIndexReader>& reader) {
9999 return reader->VisitStartsWith (prefix);
100100 });
101101}
102102
103103Result<std::shared_ptr<GlobalIndexResult>> UnionGlobalIndexReader::VisitEndsWith (
104104 const Literal& suffix) {
105- return Union ([& suffix](const std::shared_ptr<GlobalIndexReader>& reader) {
105+ return Union ([suffix](const std::shared_ptr<GlobalIndexReader>& reader) {
106106 return reader->VisitEndsWith (suffix);
107107 });
108108}
109109
110110Result<std::shared_ptr<GlobalIndexResult>> UnionGlobalIndexReader::VisitContains (
111111 const Literal& literal) {
112- return Union ([& literal](const std::shared_ptr<GlobalIndexReader>& reader) {
112+ return Union ([literal](const std::shared_ptr<GlobalIndexReader>& reader) {
113113 return reader->VisitContains (literal);
114114 });
115115}
116116
117117Result<std::shared_ptr<GlobalIndexResult>> UnionGlobalIndexReader::VisitLike (
118118 const Literal& literal) {
119- return Union ([& literal](const std::shared_ptr<GlobalIndexReader>& reader) {
119+ return Union ([literal](const std::shared_ptr<GlobalIndexReader>& reader) {
120120 return reader->VisitLike (literal);
121121 });
122122}
123123
124124Result<std::shared_ptr<ScoredGlobalIndexResult>> UnionGlobalIndexReader::VisitVectorSearch (
125125 const std::shared_ptr<VectorSearch>& vector_search) {
126126 auto results = ExecuteAllReaders<Result<std::shared_ptr<ScoredGlobalIndexResult>>>(
127- [& vector_search](const std::shared_ptr<GlobalIndexReader>& reader)
127+ [vector_search](const std::shared_ptr<GlobalIndexReader>& reader)
128128 -> Result<std::shared_ptr<ScoredGlobalIndexResult>> {
129129 return reader->VisitVectorSearch (vector_search);
130130 });
@@ -155,15 +155,13 @@ Result<std::shared_ptr<ScoredGlobalIndexResult>> UnionGlobalIndexReader::VisitVe
155155
156156Result<std::shared_ptr<GlobalIndexResult>> UnionGlobalIndexReader::VisitFullTextSearch (
157157 const std::shared_ptr<FullTextSearch>& full_text_search) {
158- return Union ([& full_text_search](const std::shared_ptr<GlobalIndexReader>& reader) {
158+ return Union ([full_text_search](const std::shared_ptr<GlobalIndexReader>& reader) {
159159 return reader->VisitFullTextSearch (full_text_search);
160160 });
161161}
162162
163163Result<std::shared_ptr<GlobalIndexResult>> UnionGlobalIndexReader::Union (ReaderAction action) {
164- auto results = ExecuteAllReaders<Result<std::shared_ptr<GlobalIndexResult>>>(
165- [&action](const std::shared_ptr<GlobalIndexReader>& reader)
166- -> Result<std::shared_ptr<GlobalIndexResult>> { return action (reader); });
164+ auto results = ExecuteAllReaders<Result<std::shared_ptr<GlobalIndexResult>>>(action);
167165
168166 std::shared_ptr<GlobalIndexResult> merged_result = nullptr ;
169167 for (auto & result_or_status : results) {
@@ -207,8 +205,7 @@ std::vector<R> UnionGlobalIndexReader::ExecuteAllReaders(
207205 std::vector<std::future<R>> futures;
208206 futures.reserve (readers_.size ());
209207 for (const auto & reader : readers_) {
210- futures.push_back (
211- Via (executor_.get (), [&action, reader]() -> R { return action (reader); }));
208+ futures.push_back (Via (executor_.get (), [action, reader]() -> R { return action (reader); }));
212209 }
213210 return CollectAll (futures);
214211}
0 commit comments