From 22881f156d215e11b4c776714cbd0aa616b0cf8b Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Thu, 11 Dec 2014 20:54:15 -0500 Subject: [PATCH] Make SubArrays immutable Since #8867 this actually makes a difference in the optimizations LLVM is able to perform. --- base/subarray.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/subarray.jl b/base/subarray.jl index 3c02ef332e356..5c5e237ccc752 100644 --- a/base/subarray.jl +++ b/base/subarray.jl @@ -5,7 +5,7 @@ typealias RangeIndex Union(Int, Range{Int}, UnitRange{Int}, Colon) # LD is the last dimension up through which this object has efficient # linear indexing. If LD==N, then the object itself has efficient # linear indexing. -type SubArray{T,N,P<:AbstractArray,I<:(ViewIndex...),LD} <: AbstractArray{T,N} +immutable SubArray{T,N,P<:AbstractArray,I<:(ViewIndex...),LD} <: AbstractArray{T,N} parent::P indexes::I dims::NTuple{N,Int}