[macruby-changes] [2467] MacRuby/trunk/lib/stringio.rb
source_changes at macosforge.org
source_changes at macosforge.org
Thu Sep 3 22:30:57 PDT 2009
Revision: 2467
http://trac.macosforge.org/projects/ruby/changeset/2467
Author: lsansonetti at apple.com
Date: 2009-09-03 22:30:56 -0700 (Thu, 03 Sep 2009)
Log Message:
-----------
use ByteString objects by default
Modified Paths:
--------------
MacRuby/trunk/lib/stringio.rb
Modified: MacRuby/trunk/lib/stringio.rb
===================================================================
--- MacRuby/trunk/lib/stringio.rb 2009-09-04 05:30:31 UTC (rev 2466)
+++ MacRuby/trunk/lib/stringio.rb 2009-09-04 05:30:56 UTC (rev 2467)
@@ -121,7 +121,7 @@
#
# See IO#read.
#
- def read(length = nil, buffer = "")
+ def read(length = nil, buffer = ByteString.new)
raise IOError, "not opened for reading" unless @readable
raise TypeError unless buffer.respond_to?(:to_str)
buffer = buffer.to_str
@@ -146,7 +146,7 @@
#
# Similar to #read, but raises +EOFError+ at end of string instead of
# returning +nil+, as well as IO#sysread does.
- def sysread(length = nil, buffer = "")
+ def sysread(length = nil, buffer = ByteString.new)
val = read(length, buffer)
( buffer.clear && raise(IO::EOFError, "end of file reached")) if val == nil
val
@@ -755,4 +755,4 @@
line
end
-end
\ No newline at end of file
+end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090903/d516e1c4/attachment.html>
More information about the macruby-changes
mailing list