From a2367342f59933b6f92b2e10adcf33f0155d99e1 Mon Sep 17 00:00:00 2001 From: John Lapeyre Date: Thu, 17 May 2018 13:24:42 +0200 Subject: [PATCH] add @inbounds, remove whitespace --- LICENSE.md | 8 ++++---- src/cdfs.jl | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index c9871a8..216b373 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,17 +1,17 @@ The EmpiricalCDFs.jl package is licensed under the MIT "Expat" License: > Copyright (c) 2016: John Lapeyre. -> +> > Permission is hereby granted, free of charge, to any person obtaining a copy > of this software and associated documentation files (the "Software"), to deal > in the Software without restriction, including without limitation the rights > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell > copies of the Software, and to permit persons to whom the Software is > furnished to do so, subject to the following conditions: -> +> > The above copyright notice and this permission notice shall be included in all > copies or substantial portions of the Software. -> +> > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -19,4 +19,4 @@ The EmpiricalCDFs.jl package is licensed under the MIT "Expat" License: > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE > SOFTWARE. -> +> diff --git a/src/cdfs.jl b/src/cdfs.jl index 4250028..63c3ca2 100644 --- a/src/cdfs.jl +++ b/src/cdfs.jl @@ -43,7 +43,7 @@ getcdfindex(cdf::AbstractEmpiricalCDF, x::Real) = searchsortedlast(cdf.xdata, x) function _getinds{T <: Real}(cdf::AbstractEmpiricalCDF, v::AbstractArray{T}) r = Array{eltype(cdf.xdata)}(size(v)...) for (i,x) in enumerate(v) - r[i] = cdf(x) + @inbounds r[i] = cdf(x) end r end @@ -288,7 +288,7 @@ function _printfull(io, cdf::AbstractEmpiricalCDF, prpts; lastpt=false) ulim = lastpt ? n : n - 1 # usually don't print ordinate value of 1 # println("ulim is ", ulim) for i in 1:ulim - xp = cdf.xdata[i] + @inbounds xp = cdf.xdata[i] if done(prpts,state) break end