Skip to content

Commit 2796fee

Browse files
committed
[fix] use RubyArray sharing that works in 9.2/9.3
1 parent 379f9d1 commit 2796fee

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -494,12 +494,12 @@ public RubyArray ciphers(final ThreadContext context) { // SSL_CTX_get_ciphers
494494
private RubyArray matchedCiphersWithCache(final ThreadContext context) {
495495
final CipherListCache cache = cipherListCache;
496496
if ( protocol.equals(cache.protocol) && ciphers.equals(cache.ciphers) ) {
497-
return newSharedArray(context, cache.cipherList);
497+
return newSharedArray(cache.cipherList);
498498
}
499499

500500
final RubyArray match = matchedCiphers(context);
501501
cipherListCache = new CipherListCache(protocol, ciphers, match);
502-
return newSharedArray(context, match);
502+
return newSharedArray(match);
503503
}
504504

505505
private RubyArray matchedCiphers(final ThreadContext context) {
@@ -526,8 +526,8 @@ private RubyArray matchedCiphers(final ThreadContext context) {
526526
}
527527
}
528528

529-
private static RubyArray newSharedArray(ThreadContext context, RubyArray array) {
530-
return array.collect(context, Block.NULL_BLOCK); // shares underlying IRubyObject[] values
529+
private static RubyArray newSharedArray(RubyArray array) {
530+
return (RubyArray) array.dup(); // shares underlying IRubyObject[] values
531531
}
532532

533533
@JRubyMethod(name = "ciphers=")

0 commit comments

Comments
 (0)