@@ -215,11 +215,17 @@ map(f, t::Tuple{Any, Any}) = (@_inline_meta; (f(t[1]), f(t[2])))
215
215
map (f, t:: Tuple{Any, Any, Any} ) = (@_inline_meta ; (f (t[1 ]), f (t[2 ]), f (t[3 ])))
216
216
map (f, t:: Tuple ) = (@_inline_meta ; (f (t[1 ]), map (f,tail (t))... ))
217
217
# stop inlining after some number of arguments to avoid code blowup
218
- const Any16{N} = Tuple{Any,Any,Any,Any,Any,Any,Any,Any,
219
- Any,Any,Any,Any,Any,Any,Any,Any,Vararg{Any,N}}
220
- const All16{T,N} = Tuple{T,T,T,T,T,T,T,T,
221
- T,T,T,T,T,T,T,T,Vararg{T,N}}
222
- function map (f, t:: Any16 )
218
+ const Any32{N} = Tuple{Any,Any,Any,Any,Any,Any,Any,Any,
219
+ Any,Any,Any,Any,Any,Any,Any,Any,
220
+ Any,Any,Any,Any,Any,Any,Any,Any,
221
+ Any,Any,Any,Any,Any,Any,Any,Any,
222
+ Vararg{Any,N}}
223
+ const All32{T,N} = Tuple{T,T,T,T,T,T,T,T,
224
+ T,T,T,T,T,T,T,T,
225
+ T,T,T,T,T,T,T,T,
226
+ T,T,T,T,T,T,T,T,
227
+ Vararg{T,N}}
228
+ function map (f, t:: Any32 )
223
229
n = length (t)
224
230
A = Vector {Any} (undef, n)
225
231
for i= 1 : n
@@ -235,7 +241,7 @@ function map(f, t::Tuple, s::Tuple)
235
241
@_inline_meta
236
242
(f (t[1 ],s[1 ]), map (f, tail (t), tail (s))... )
237
243
end
238
- function map (f, t:: Any16 , s:: Any16 )
244
+ function map (f, t:: Any32 , s:: Any32 )
239
245
n = length (t)
240
246
A = Vector {Any} (undef, n)
241
247
for i = 1 : n
@@ -251,7 +257,7 @@ function map(f, t1::Tuple, t2::Tuple, ts::Tuple...)
251
257
@_inline_meta
252
258
(f (heads (t1, t2, ts... )... ), map (f, tails (t1, t2, ts... )... )... )
253
259
end
254
- function map (f, t1:: Any16 , t2:: Any16 , ts:: Any16 ... )
260
+ function map (f, t1:: Any32 , t2:: Any32 , ts:: Any32 ... )
255
261
n = length (t1)
256
262
A = Vector {Any} (undef, n)
257
263
for i = 1 : n
@@ -317,8 +323,8 @@ function _totuple(T, itr, s...)
317
323
end
318
324
319
325
# use iterative algorithm for long tuples
320
- function _totuple (T:: Type{All16 {E,N}} , itr) where {E,N}
321
- len = N+ 16
326
+ function _totuple (T:: Type{All32 {E,N}} , itr) where {E,N}
327
+ len = N+ 32
322
328
elts = collect (E, Iterators. take (itr,len))
323
329
if length (elts) != len
324
330
_totuple_err (T)
@@ -342,15 +348,15 @@ end
342
348
filter (f, xs:: Tuple ) = afoldl ((ys, x) -> f (x) ? (ys... , x) : ys, (), xs... )
343
349
344
350
# use Array for long tuples
345
- filter (f, t:: Any16 ) = Tuple (filter (f, collect (t)))
351
+ filter (f, t:: Any32 ) = Tuple (filter (f, collect (t)))
346
352
347
353
# # comparison ##
348
354
349
355
isequal (t1:: Tuple , t2:: Tuple ) = (length (t1) == length (t2)) && _isequal (t1, t2)
350
356
_isequal (t1:: Tuple{} , t2:: Tuple{} ) = true
351
357
_isequal (t1:: Tuple{Any} , t2:: Tuple{Any} ) = isequal (t1[1 ], t2[1 ])
352
358
_isequal (t1:: Tuple , t2:: Tuple ) = isequal (t1[1 ], t2[1 ]) && _isequal (tail (t1), tail (t2))
353
- function _isequal (t1:: Any16 , t2:: Any16 )
359
+ function _isequal (t1:: Any32 , t2:: Any32 )
354
360
for i = 1 : length (t1)
355
361
if ! isequal (t1[i], t2[i])
356
362
return false
@@ -380,7 +386,7 @@ function _eq_missing(t1::Tuple, t2::Tuple)
380
386
return _eq_missing (tail (t1), tail (t2))
381
387
end
382
388
end
383
- function _eq (t1:: Any16 , t2:: Any16 )
389
+ function _eq (t1:: Any32 , t2:: Any32 )
384
390
anymissing = false
385
391
for i = 1 : length (t1)
386
392
eq = (t1[i] == t2[i])
396
402
const tuplehash_seed = UInt === UInt64 ? 0x77cfa1eef01bca90 : 0xf01bca90
397
403
hash (:: Tuple{} , h:: UInt ) = h + tuplehash_seed
398
404
hash (t:: Tuple , h:: UInt ) = hash (t[1 ], hash (tail (t), h))
399
- function hash (t:: Any16 , h:: UInt )
405
+ function hash (t:: Any32 , h:: UInt )
400
406
out = h + tuplehash_seed
401
407
for i = length (t): - 1 : 1
402
408
out = hash (t[i], out)
@@ -417,7 +423,7 @@ function <(t1::Tuple, t2::Tuple)
417
423
end
418
424
return tail (t1) < tail (t2)
419
425
end
420
- function < (t1:: Any16 , t2:: Any16 )
426
+ function < (t1:: Any32 , t2:: Any32 )
421
427
n1, n2 = length (t1), length (t2)
422
428
for i = 1 : min (n1, n2)
423
429
a, b = t1[i], t2[i]
@@ -444,7 +450,7 @@ function isless(t1::Tuple, t2::Tuple)
444
450
a, b = t1[1 ], t2[1 ]
445
451
isless (a, b) || (isequal (a, b) && isless (tail (t1), tail (t2)))
446
452
end
447
- function isless (t1:: Any16 , t2:: Any16 )
453
+ function isless (t1:: Any32 , t2:: Any32 )
448
454
n1, n2 = length (t1), length (t2)
449
455
for i = 1 : min (n1, n2)
450
456
a, b = t1[i], t2[i]
0 commit comments