Skip to content

Commit 5e5bdc2

Browse files
committed
Update non_hp_stat.jl
1 parent db544f4 commit 5e5bdc2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/stat/non_hp_stat.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ Base.@propagate_inbounds function k_largest(x::AbstractVector{T}, k::Int) where
444444
end
445445
end
446446
if cnt < k
447-
allowmissing(res[1:cnt])
447+
allowmissing(view(res, 1:cnt))
448448
else
449449
allowmissing(res)
450450
end
@@ -464,7 +464,7 @@ Base.@propagate_inbounds function k_smallest(x::AbstractVector{T}, k::Int) where
464464
end
465465
end
466466
if cnt < k
467-
allowmissing(res[1:cnt])
467+
allowmissing(view(res, 1:cnt))
468468
else
469469
allowmissing(res)
470470
end
@@ -490,7 +490,7 @@ Base.@propagate_inbounds function k_largest_perm(x::AbstractVector{T}, k::Int) w
490490
end
491491
end
492492
if cnt < k
493-
allowmissing(perm[1:cnt])
493+
allowmissing(view(perm, 1:cnt))
494494
else
495495
allowmissing(perm)
496496
end
@@ -513,7 +513,7 @@ Base.@propagate_inbounds function k_smallest_perm(x::AbstractVector{T}, k::Int)
513513
end
514514
end
515515
if cnt < k
516-
allowmissing(perm[1:cnt])
516+
allowmissing(view(perm, 1:cnt))
517517
else
518518
allowmissing(perm)
519519
end

0 commit comments

Comments
 (0)