Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 434ae23

Browse files
authored
Merge pull request JuliaLang#18934 from JuliaLang/jb/coreimgiters
remove `iterator.jl` from coreimg
2 parents 3d400f9 + b438191 commit 434ae23

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ CORE_SRCS := $(addprefix $(JULIAHOME)/, \
198198
base/inference.jl \
199199
base/int.jl \
200200
base/intset.jl \
201-
base/iterator.jl \
202201
base/nofloat_hashing.jl \
203202
base/number.jl \
204203
base/operators.jl \

base/coreimg.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ include("reduce.jl")
5959
## core structures
6060
include("intset.jl")
6161
include("associative.jl")
62-
include("iterator.jl")
6362

6463
# core docsystem
6564
include("docs/core.jl")

base/essentials.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ function tuple_type_tail(T::DataType)
6363
return Tuple{argtail(T.parameters...)...}
6464
end
6565

66+
tuple_type_cons{S}(::Type{S}, ::Type{Union{}}) = Union{}
67+
function tuple_type_cons{S,T<:Tuple}(::Type{S}, ::Type{T})
68+
@_pure_meta
69+
Tuple{S, T.parameters...}
70+
end
71+
6672
isvarargtype(t::ANY) = isa(t, DataType) && is((t::DataType).name, Vararg.name)
6773
isvatuple(t::DataType) = (n = length(t.parameters); n > 0 && isvarargtype(t.parameters[n]))
6874
unwrapva(t::ANY) = isvarargtype(t) ? t.parameters[1] : t
@@ -231,3 +237,5 @@ function vector_any(xs::ANY...)
231237
end
232238
a
233239
end
240+
241+
isempty(itr) = done(itr, start(itr))

base/inference.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,8 @@ function abstract_apply(af::ANY, fargs, aargtypes::Vector{Any}, vtypes::VarTable
10191019
end
10201020

10211021
function pure_eval_call(f::ANY, argtypes::ANY, atype::ANY, vtypes::VarTable, sv::InferenceState)
1022-
for a in drop(argtypes,1)
1022+
for i = 2:length(argtypes)
1023+
a = argtypes[i]
10231024
if !(isa(a,Const) || isconstType(a,false))
10241025
return false
10251026
end
@@ -1055,7 +1056,7 @@ function pure_eval_call(f::ANY, argtypes::ANY, atype::ANY, vtypes::VarTable, sv:
10551056
return false
10561057
end
10571058

1058-
args = Any[ isa(a,Const) ? a.val : a.parameters[1] for a in drop(argtypes,1) ]
1059+
args = Any[ (a=argtypes[i]; isa(a,Const) ? a.val : a.parameters[1]) for i in 2:length(argtypes) ]
10591060
try
10601061
return abstract_eval_constant(f(args...))
10611062
catch

base/iterator.jl

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# This file is a part of Julia. License is MIT: http://julialang.org/license
22

3-
isempty(itr) = done(itr, start(itr))
4-
53
_min_length(a, b, ::IsInfinite, ::IsInfinite) = min(length(a),length(b)) # inherit behaviour, error
64
_min_length(a, b, A, ::IsInfinite) = length(a)
75
_min_length(a, b, ::IsInfinite, B) = length(b)
@@ -143,11 +141,6 @@ zip(a, b, c...) = Zip(a, zip(b, c...))
143141
length(z::Zip) = _min_length(z.a, z.z, iteratorsize(z.a), iteratorsize(z.z))
144142
size(z::Zip) = promote_shape(size(z.a), size(z.z))
145143
indices(z::Zip) = promote_shape(indices(z.a), indices(z.z))
146-
tuple_type_cons{S}(::Type{S}, ::Type{Union{}}) = Union{}
147-
function tuple_type_cons{S,T<:Tuple}(::Type{S}, ::Type{T})
148-
@_pure_meta
149-
Tuple{S, T.parameters...}
150-
end
151144
eltype{I,Z}(::Type{Zip{I,Z}}) = tuple_type_cons(eltype(I), eltype(Z))
152145
@inline start(z::Zip) = tuple(start(z.a), start(z.z))
153146
@inline function next(z::Zip, st)

0 commit comments

Comments
 (0)