Skip to content

Commit 65a5ca3

Browse files
authored
simple_hash faster by lifting length(str)
1 parent ef9b8dd commit 65a5ca3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/tokenize.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1339,7 +1339,8 @@ end
13391339
function simple_hash(str)
13401340
ind = 1
13411341
h = UInt64(0)
1342-
while ind <= length(str)
1342+
L = length(str)
1343+
while ind <= L
13431344
h = simple_hash(str[ind], h)
13441345
ind = nextind(str, ind)
13451346
end

0 commit comments

Comments
 (0)