Skip to content

Commit

Permalink
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/ruby/stdlib/jruby/core_ext/string.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
require 'java'
require 'jruby'

class String

@@ -8,7 +6,9 @@ class String
#
# May be useful in cases where you know how large a string will grow, and want
# to pre-allocate the buffer for that size.
#
# @deprecated use String.new(capacity: size)
def self.alloc(size)
org.jruby.RubyString.new_string_light(JRuby.runtime, size)
new(capacity: size)
end
end

0 comments on commit 9e42dce

Please sign in to comment.