From 25227c10684b36d7c030250df30ce266c5eaa99c Mon Sep 17 00:00:00 2001 From: Jishnu Bhattacharya Date: Mon, 20 May 2024 20:21:48 +0530 Subject: [PATCH] Aggressive constprop in norm (#54523) --- stdlib/LinearAlgebra/src/generic.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/LinearAlgebra/src/generic.jl b/stdlib/LinearAlgebra/src/generic.jl index 052b170bceacc..bdb4ad5ac8563 100644 --- a/stdlib/LinearAlgebra/src/generic.jl +++ b/stdlib/LinearAlgebra/src/generic.jl @@ -666,7 +666,7 @@ julia> norm(hcat(v,v), Inf) == norm(vcat(v,v), Inf) != norm([v,v], Inf) true ``` """ -function norm(itr, p::Real=2) +Base.@constprop :aggressive function norm(itr, p::Real=2) isempty(itr) && return float(norm(zero(eltype(itr)))) if p == 2 return norm2(itr)