Skip to content

Commit 07975ff

Browse files
fix CachedDataset
1 parent 42cc48f commit 07975ff

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/containers/cacheddataset.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ struct CachedDataset{T, S}
2626
cache::S
2727
end
2828

29+
CachedDataset(source, cachesize::Int) = CachedDataset(source, 1:cachesize)
30+
2931
CachedDataset(source, cacheidx::AbstractVector{<:Integer} = 1:numobs(source)) =
3032
CachedDataset(source, collect(cacheidx), make_cache(source, cacheidx))
31-
CachedDataset(source, cachesize::Int = numobs(source)) = CachedDataset(source, 1:cachesize)
3233

3334
function Base.getindex(dataset::CachedDataset, i::Integer)
3435
_i = findfirst(==(i), dataset.cacheidx)

0 commit comments

Comments
 (0)