Skip to content

Commit

Permalink
chore: Remove template Callbacks
Browse files Browse the repository at this point in the history
Signed-off-by: Stepan Bagritsevich <[email protected]>
  • Loading branch information
BagritsevichStepan committed Jan 8, 2025
1 parent 933c9f0 commit d1d749f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/server/json_family.cc
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,9 @@ bool JsonAreEquals(const JsonType& lhs, const JsonType& rhs) {
}
}

template <typename Callback>
OpResult<DbSlice::AddOrFindResult> SetJson(const OpArgs& op_args, string_view key,
Callback parse_json_value) {
OpResult<DbSlice::AddOrFindResult> SetJson(
const OpArgs& op_args, string_view key,
absl::FunctionRef<OpResult<JsonType>()> parse_json_value) {
auto& db_slice = op_args.GetDbSlice();

auto op_res = db_slice.AddOrFind(op_args.db_cntx, key);
Expand Down
4 changes: 2 additions & 2 deletions src/server/search/doc_accessors.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ FieldValue ExtractSortableValueFromJson(const search::Schema& schema, string_vie
}

/* Returns true if json elements were successfully processed. */
template <typename Callback>
bool ProcessJsonElements(const std::vector<JsonType>& json_elements, Callback&& cb) {
bool ProcessJsonElements(const std::vector<JsonType>& json_elements,
absl::FunctionRef<bool(const JsonType&)> cb) {
auto process = [&cb](const auto& json_range) -> bool {
for (const auto& json : json_range) {
if (!json.is_null() && !cb(json)) {
Expand Down

0 comments on commit d1d749f

Please sign in to comment.