From c2bb51e35e7d2e5df978552cf27dae576cdeac8a Mon Sep 17 00:00:00 2001 From: Tim Sterne-Weiler Date: Sun, 21 May 2017 12:27:32 -0700 Subject: [PATCH 1/2] Force Int casting of char key --- src/sais.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sais.jl b/src/sais.jl index 26696be..24a6b1e 100644 --- a/src/sais.jl +++ b/src/sais.jl @@ -30,8 +30,8 @@ type IntArray pos::Int end import Base: getindex, setindex! -getindex(a::IntArray,key) = a.a[a.pos + key] -setindex!(a::IntArray,value,key) = a.a[a.pos + key] = value +getindex(a::IntArray,key) = a.a[a.pos + Int(key)] +setindex!(a::IntArray,value,key) = a.a[a.pos + Int(key)] = value # "banana" = [5 3 1 0 4 2] # "banana" = [6, 4, 2, 1, 5, 3] From 21cf410dbae440fde6acf0a324a11987c0dad495 Mon Sep 17 00:00:00 2001 From: Tim Sterne-Weiler Date: Sun, 21 May 2017 12:34:10 -0700 Subject: [PATCH 2/2] Line 259: x::Char == y::Integer is deprecated --- src/sais.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sais.jl b/src/sais.jl index 24a6b1e..a972901 100644 --- a/src/sais.jl +++ b/src/sais.jl @@ -256,7 +256,7 @@ function LMSsort(T, SA, C, B, n, k) for i = n:-1:1 if 0 < (j = SA[i]) c0 = T[j+1] - if c0 != c1 + if Int(c0) != Int(c1) B[c1+1] = b c1 = c0 b = B[Int(c1)+1]