Skip to content

Commit

Permalink
allocate tail with a size in transient vector
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaong committed Feb 8, 2016
1 parent 97cc058 commit 70b6a12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/immutable/vector.cr
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ module Immutable

def initialize
@trie = Trie(T).empty(object_id)
@tail = [] of T
@tail = Array(T).new(Trie::BLOCK_SIZE)
end

def initialize(elems : Array(T))
Expand All @@ -561,7 +561,7 @@ module Immutable
@tail << elem
if @tail.size == Trie::BLOCK_SIZE
@trie = @trie.push_leaf!(@tail, object_id)
@tail = [] of T
@tail = Array(T).new(Trie::BLOCK_SIZE)
end
self
end
Expand Down

0 comments on commit 70b6a12

Please sign in to comment.