Skip to content

Commit f03bcc1

Browse files
committed
return early instead of going respond_to? - gets String/IO frequently
1 parent f917e60 commit f03bcc1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/main/java/org/jruby/ext/openssl/OpenSSL.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ static SecureRandom getSecureRandomFrom(final ThreadContext context) {
324324
// internals
325325

326326
static IRubyObject to_der_if_possible(final ThreadContext context, IRubyObject obj) {
327+
if ( obj instanceof RubyString || obj instanceof RubyIO ) return obj;
327328
if ( ! obj.respondsTo("to_der")) return obj;
328329
return obj.callMethod(context, "to_der");
329330
}

0 commit comments

Comments
 (0)