Assistant: Replace usages of adopt_ref() with make_ref_counted()

Let's be consistent with how we construct Result objects.
This commit is contained in:
Tim Ledbetter 2023-04-13 07:12:42 +01:00 committed by Sam Atkins
parent 493fc65e42
commit e144b477bd
Notes: sideshowbarker 2024-07-17 05:03:11 +09:00

View File

@ -117,7 +117,7 @@ void CalculatorProvider::query(DeprecatedString const& query, Function<void(Vect
}
Vector<NonnullRefPtr<Result>> results;
results.append(adopt_ref(*new CalculatorResult(calculation)));
results.append(make_ref_counted<CalculatorResult>(calculation));
on_complete(move(results));
}
@ -235,7 +235,7 @@ void TerminalProvider::query(DeprecatedString const& query, Function<void(Vector
auto command = query.substring(1).trim_whitespace();
Vector<NonnullRefPtr<Result>> results;
results.append(adopt_ref(*new TerminalResult(move(command))));
results.append(make_ref_counted<TerminalResult>(move(command)));
on_complete(move(results));
}
@ -257,7 +257,7 @@ void URLProvider::query(DeprecatedString const& query, Function<void(Vector<Nonn
return;
Vector<NonnullRefPtr<Result>> results;
results.append(adopt_ref(*new URLResult(url)));
results.append(make_ref_counted<URLResult>(url));
on_complete(results);
}