Skip to content

Commit

Permalink
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/string_pool.cr
Original file line number Diff line number Diff line change
@@ -95,11 +95,11 @@ class StringPool
# Otherwise a new string is created, put in the pool and returned
#
# ```
# pool = StringPool.new
# io = MemoryIO.new "crystal"
# pool.empty? # => true
# pool.get(io)
# pool.empty? # => false
# pool = StringPool.new
# io = MemoryIO.new "crystal"
# pool.empty? # => true
# pool.get(io)
# pool.empty? # => false
# ```
def get(str : MemoryIO)
get(str.buffer, str.bytesize)
@@ -111,11 +111,11 @@ class StringPool
# Otherwise a new string is created, put in the pool and returned
#
# ```
# pool = StringPool.new
# string = "crystal"
# pool.empty? # => true
# pool.get(string)
# pool.empty? # => false
# pool = StringPool.new
# string = "crystal"
# pool.empty? # => true
# pool.get(string)
# pool.empty? # => false
# ```
def get(str : String)
get(str.to_unsafe, str.bytesize)

0 comments on commit 5213d0b

Please sign in to comment.