Skip to content

Commit 9500e2e

Browse files
committed
Remove some anonymous functions
1 parent ea8afeb commit 9500e2e

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/DataLayouts/has_uniform_datalayouts.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@inline function first_datalayout_in_bc(args::Tuple, rargs...)
2-
idx = unrolled_findfirst(x -> x isa AbstractData, args)
2+
idx = unrolled_findfirst(Base.Fix2(isa, AbstractData), args)
33
return isnothing(idx) ? nothing : args[idx]
44
end
55

src/MatrixFields/field_name_dict.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ struct FieldNameDict{
5151
end
5252
end
5353
function FieldNameDict{T}(key_entry_pairs::Pair{<:T}...) where {T}
54-
keys = unrolled_map(pair -> pair[1], key_entry_pairs)
55-
entries = unrolled_map(pair -> pair[2], key_entry_pairs)
54+
keys = unrolled_map(first, key_entry_pairs)
55+
entries = unrolled_map(last, key_entry_pairs)
5656
return FieldNameDict(FieldNameSet{T}(keys), entries)
5757
end
5858

@@ -466,7 +466,7 @@ parent of the first entry in `dict` that is a `Fields.Field`. If no such entry
466466
is found, `target_type` defaults to `Number`.
467467
"""
468468
function get_scalar_keys(dict::FieldMatrix)
469-
first_field_idx = unrolled_findfirst(x -> x isa Fields.Field, dict.entries)
469+
first_field_idx = unrolled_findfirst(Base.Fix2(isa, Fields.Field), dict.entries)
470470
target_type = Val(
471471
isnothing(first_field_idx) ? Number :
472472
eltype(parent(dict.entries[first_field_idx])),
@@ -597,7 +597,7 @@ function check_diagonal_matrix(matrix, error_message_start = "The matrix")
597597
!is_diagonal_matrix_entry(pair[2])
598598
end
599599
non_diagonal_entry_keys =
600-
FieldMatrixKeys(unrolled_map(pair -> pair[1], non_diagonal_entry_pairs))
600+
FieldMatrixKeys(unrolled_map(first, non_diagonal_entry_pairs))
601601
isempty(non_diagonal_entry_keys) || error(
602602
"$error_message_start has non-diagonal entries at the following keys: \
603603
$(set_string(non_diagonal_entry_keys))",
@@ -611,7 +611,7 @@ Checks whether the `FieldNameDict` `dict` contains any un-materialized
611611
`AbstractBroadcasted` entries.
612612
"""
613613
is_lazy(dict) =
614-
unrolled_any(entry -> entry isa Base.AbstractBroadcasted, values(dict))
614+
unrolled_any(Base.Fix2(isa, Base.AbstractBroadcasted), values(dict))
615615

616616
"""
617617
lazy_main_diagonal(matrix)

src/MatrixFields/operator_matrices.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ has_affine_bc(op) = any(
7373
op.bcs,
7474
)
7575

76-
uses_extrapolate(op) = unrolled_any(bc -> bc isa Operators.Extrapolate, op.bcs)
76+
uses_extrapolate(op) = unrolled_any(Base.Fix2(isa, Operators.Extrapolate), op.bcs)
7777

7878
################################################################################
7979

0 commit comments

Comments
 (0)