Skip to content

Commit ab255f7

Browse files
committed
[TextAPI] Use function_ref where possible, NFCI (llvm#76732)
(cherry picked from commit 8fa3184)
1 parent 94d8e78 commit ab255f7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/lib/TextAPI/TextStubV5.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,9 @@ Expected<StubT> getRequiredValue(
201201
template <typename JsonT, typename StubT = JsonT>
202202
Expected<StubT> getRequiredValue(
203203
TBDKey Key, const Object *Obj,
204-
std::function<std::optional<JsonT>(const Object *, StringRef)> GetValue,
205-
StubT DefaultValue, std::function<std::optional<StubT>(JsonT)> Validate) {
204+
std::function<std::optional<JsonT>(const Object *, StringRef)> const
205+
GetValue,
206+
StubT DefaultValue, function_ref<std::optional<StubT>(JsonT)> Validate) {
206207
std::optional<JsonT> Val = GetValue(Obj, Keys[Key]);
207208
if (!Val)
208209
return DefaultValue;
@@ -215,7 +216,7 @@ Expected<StubT> getRequiredValue(
215216
}
216217

217218
Error collectFromArray(TBDKey Key, const Object *Obj,
218-
std::function<void(StringRef)> Append,
219+
function_ref<void(StringRef)> Append,
219220
bool IsRequired = false) {
220221
const auto *Values = Obj->getArray(Keys[Key]);
221222
if (!Values) {

0 commit comments

Comments
 (0)