Skip to content

Conversation

@jishnub
Copy link
Member

@jishnub jishnub commented Feb 11, 2021

There's often no need to iterate over these special arrays to check if a value is contained in them.

Now

julia> A = Ones(10_000, 10_000);

julia> @btime 4000 in $(Ref(A))[]
  2.670 ns (0 allocations: 0 bytes)
false

julia> @btime 1 in $(Ref(A))[]
  2.670 ns (0 allocations: 0 bytes)
true

@jishnub jishnub changed the title Add methods to in Check if a value is present in an AbstractFill without iterating over it Feb 11, 2021
@codecov
Copy link

codecov bot commented Feb 11, 2021

Codecov Report

Merging #136 (b7c7cd2) into master (59023c4) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #136      +/-   ##
==========================================
+ Coverage   95.53%   95.55%   +0.01%     
==========================================
  Files           4        4              
  Lines         515      517       +2     
==========================================
+ Hits          492      494       +2     
  Misses         23       23              
Impacted Files Coverage Δ
src/FillArrays.jl 94.17% <100.00%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 59023c4...b7c7cd2. Read the comment docs.

@dlfivefifty
Copy link
Member

If you bump the patch version I can tag right away

@dlfivefifty dlfivefifty merged commit 358e948 into JuliaArrays:master Feb 12, 2021
@jishnub jishnub deleted the in branch February 12, 2021 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants