Skip to content

Conversation

@jishnub
Copy link
Member

@jishnub jishnub commented Feb 9, 2024

Since an AbstractFill is by definition filled with values, we may short-circuit isassigned:

julia> F = Fill(3, 100, 100);

julia> @btime isassigned($(Ref(F))[], 1, 1)
  24.297 ns (0 allocations: 0 bytes) # master
  3.360 ns (0 allocations: 0 bytes) # PR

@codecov
Copy link

codecov bot commented Feb 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.90%. Comparing base (99278fa) to head (e36922a).
Report is 16 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #351   +/-   ##
=======================================
  Coverage   99.90%   99.90%           
=======================================
  Files           8        8           
  Lines        1037     1061   +24     
=======================================
+ Hits         1036     1060   +24     
  Misses          1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@longemen3000
Copy link

seems good to merge, at first i thought that this would affect OneElement, but that type subtypes AbstractArray instead

@jishnub
Copy link
Member Author

jishnub commented Apr 26, 2024

I've specialized isassigned for a OneElement as well, as the same logic would apply. Since the array is always initialized with a value, the elements should all be assigned as long as they are in range.

@jishnub jishnub requested a review from dlfivefifty April 28, 2024 08:30
@jishnub jishnub merged commit dfe0e62 into master May 4, 2024
@jishnub jishnub deleted the isassigned branch May 4, 2024 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants