Skip to content

Commit

Permalink
Showing 3 changed files with 6 additions and 21 deletions.
12 changes: 6 additions & 6 deletions core/src/main/java/org/jruby/RubyIO.java
Original file line number Diff line number Diff line change
@@ -1610,15 +1610,15 @@ public IRubyObject printf(ThreadContext context, IRubyObject[] args) {

@JRubyMethod(required = 1)
public IRubyObject putc(ThreadContext context, IRubyObject ch) {
Ruby runtime = context.runtime;
IRubyObject str;
if (ch instanceof RubyString) {
str = ((RubyString)ch).substr(runtime, 0, 1);
}
else {
str = RubyString.newStringShared(runtime, RubyFixnum.SINGLE_CHAR_BYTELISTS19[RubyNumeric.num2chr(ch) & 0xFF]);
str = ((RubyString)ch).substr(context.runtime, 0, 1);
} else {
str = RubyString.newStringShared(context.runtime, RubyFixnum.SINGLE_CHAR_BYTELISTS19[RubyNumeric.num2chr(ch) & 0xFF]);
}
write(context, str);

sites(context).write.call(context, this, this, str);

return ch;
}

5 changes: 0 additions & 5 deletions spec/tags/ruby/core/io/putc_tags.txt

This file was deleted.

10 changes: 0 additions & 10 deletions spec/tags/ruby/core/kernel/putc_tags.txt

This file was deleted.

1 comment on commit baf0af9

@kares
Copy link
Member

@kares kares commented on baf0af9 Feb 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 najs!

Please sign in to comment.