File tree Expand file tree Collapse file tree 5 files changed +8
-12
lines changed Expand file tree Collapse file tree 5 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ class Filter {
164
164
* Memoized list of all field filters that can be found by
165
165
* traversing the tree of filters contained in this composite filter.
166
166
*/
167
- mutable util::ThreadSafeMemoizer<std::vector<FieldFilter>>
167
+ mutable util::ThreadSafeMemoizer<const std::vector<FieldFilter>>
168
168
memoized_flattened_filters_;
169
169
};
170
170
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ absl::optional<Operator> Query::FindOpInsideFilters(
92
92
return absl::nullopt;
93
93
}
94
94
95
- std::shared_ptr<std::vector<OrderBy>> Query::CalculateNormalizedOrderBys ()
95
+ std::shared_ptr<const std::vector<OrderBy>> Query::CalculateNormalizedOrderBys ()
96
96
const {
97
97
// Any explicit order by fields should be added as is.
98
98
auto result = std::make_shared<std::vector<OrderBy>>(explicit_order_bys_);
Original file line number Diff line number Diff line change @@ -299,14 +299,10 @@ class Query {
299
299
300
300
Target ToTarget (const std::vector<OrderBy>& order_bys) const ;
301
301
302
- // For properties below, use a `std::shared_ptr<ThreadSafeMemoizer>` rather
303
- // than using `ThreadSafeMemoizer` directly so that this class is copyable
304
- // (`ThreadSafeMemoizer` is not copyable because of its `std::once_flag`
305
- // member variable, which is not copyable).
306
-
307
302
// The memoized list of sort orders.
308
- std::shared_ptr<std::vector<OrderBy>> CalculateNormalizedOrderBys () const ;
309
- mutable util::ThreadSafeMemoizer<std::vector<OrderBy>>
303
+ std::shared_ptr<const std::vector<OrderBy>> CalculateNormalizedOrderBys ()
304
+ const ;
305
+ mutable util::ThreadSafeMemoizer<const std::vector<OrderBy>>
310
306
memoized_normalized_order_bys_;
311
307
312
308
// The corresponding Target of this Query instance.
Original file line number Diff line number Diff line change @@ -81,15 +81,15 @@ CountingFunc::CountingFunc(std::vector<std::string> chunks)
81
81
std::function<std::shared_ptr<std::string>()> CountingFunc::func (
82
82
std::string cookie) {
83
83
return [this , cookie = std::move (cookie)] {
84
- return std::make_shared<std::string>(Next (cookie));
84
+ return std::make_shared<std::string>(NextFuncReturnValue (cookie));
85
85
};
86
86
}
87
87
88
88
int CountingFunc::invocation_count () const {
89
89
return count_.load (std::memory_order_acquire);
90
90
}
91
91
92
- std::string CountingFunc::Next (const std::string& cookie) {
92
+ std::string CountingFunc::NextFuncReturnValue (const std::string& cookie) {
93
93
const int id = count_.fetch_add (1 , std::memory_order_acq_rel);
94
94
std::ostringstream ss;
95
95
for (const std::string& chunk : chunks_) {
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ class CountingFunc {
97
97
std::vector<std::string> chunks_;
98
98
99
99
explicit CountingFunc (std::vector<std::string> chunks);
100
- std::string Next (const std::string& cookie);
100
+ std::string NextFuncReturnValue (const std::string& cookie);
101
101
};
102
102
103
103
/* *
You can’t perform that action at this time.
0 commit comments