From 9ced1bfbb3e6b6d1aa9f98e9c42c159b0a5e0bab Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Thu, 26 Oct 2017 05:36:14 -0400 Subject: [PATCH] inbounds a few tuple loops (#24335) --- base/tuple.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/base/tuple.jl b/base/tuple.jl index 72f13b1b82aed..3b0bda4ce264a 100644 --- a/base/tuple.jl +++ b/base/tuple.jl @@ -257,7 +257,7 @@ function isequal(t1::Tuple, t2::Tuple) if length(t1) != length(t2) return false end - for i = 1:length(t1) + @inbounds for i = 1:length(t1) if !isequal(t1[i], t2[i]) return false end @@ -269,7 +269,7 @@ function ==(t1::Tuple, t2::Tuple) if length(t1) != length(t2) return false end - for i = 1:length(t1) + @inbounds for i = 1:length(t1) if !(t1[i] == t2[i]) return false end @@ -285,7 +285,7 @@ hash(x::Tuple, h::UInt) = hash(x[1], hash(x[2], hash(tail(tail(x)), h)) function isless(t1::Tuple, t2::Tuple) n1, n2 = length(t1), length(t2) - for i = 1:min(n1, n2) + @inbounds for i = 1:min(n1, n2) a, b = t1[i], t2[i] if !isequal(a, b) return isless(a, b)