Skip to content

Commit 64ac638

Browse files
committed
Fix deprecations in test/dict.jl
1 parent 85f8b85 commit 64ac638

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/dict.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ import Base.==
526526

527527
const global hashoffset = [UInt(190)]
528528

529-
Base.hash(s::MyString) = hash(s.str) + hashoffset[]
529+
Base.hash(s::MyString) = hash(s.str) + hashoffset[1]
530530
Base.endof(s::MyString) = endof(s.str)
531531
Base.next(s::MyString, v::Int) = next(s.str, v)
532532
Base.isequal(a::MyString, b::MyString) = isequal(a.str, b.str)
@@ -559,7 +559,7 @@ let badKeys = [
559559
# Walk through all possible hash values (mod size of hash table)
560560
for offset = 0:1023
561561
d2 = Dict{MyString,Int}()
562-
hashoffset[] = offset
562+
hashoffset[1] = offset
563563
for i = 1:length(badKeys)
564564
d2[MyString(badKeys[i])] = i
565565
end
@@ -574,7 +574,7 @@ immutable MyInt <: Integer
574574
val::UInt
575575
end
576576

577-
Base.hash(v::MyInt) = v.val + hashoffset[]
577+
Base.hash(v::MyInt) = v.val + hashoffset[1]
578578
Base.endof(v::MyInt) = endof(v.val)
579579
Base.next(v::MyInt, i::Int) = next(v.val, i)
580580
Base.isequal(a::MyInt, b::MyInt) = isequal(a.val, b.val)
@@ -589,7 +589,7 @@ let badKeys = UInt16[0xb800,0xa501,0xcdff,0x6303,0xe40a,0xcf0e,0xf3df,0xae99,0x9
589589
# Walk through all possible hash values (mod size of hash table)
590590
for offset = 0:1023
591591
d2 = Dict{MyInt, Int}()
592-
hashoffset[] = offset
592+
hashoffset[1] = offset
593593
for i = 1:length(badKeys)
594594
d2[MyInt(badKeys[i])] = i
595595
end

0 commit comments

Comments
 (0)