Skip to content

Commit

Permalink
remove 'dummy' getClass() from RubyRegexp (#5410)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahorek authored and kares committed Nov 16, 2018
1 parent bc004e2 commit a0fc962
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions core/src/main/java/org/jruby/RubyRegexp.java
Original file line number Diff line number Diff line change
Expand Up @@ -325,14 +325,12 @@ public RubyRegexp(Ruby runtime, Regex pattern, ByteList str, RegexpOptions optio

private RubyRegexp(Ruby runtime, ByteList str) {
this(runtime);
str.getClass();
this.str = str;
this.pattern = getRegexpFromCache(runtime, str, str.getEncoding(), RegexpOptions.NULL_OPTIONS);
}

private RubyRegexp(Ruby runtime, ByteList str, RegexpOptions options) {
this(runtime);
str.getClass();

regexpInitialize(str, str.getEncoding(), options);
}
Expand Down Expand Up @@ -390,7 +388,6 @@ public static RubyRegexp newRegexp(Ruby runtime, ByteList pattern) {

static RubyRegexp newRegexp(Ruby runtime, ByteList str, Regex pattern) {
RubyRegexp regexp = new RubyRegexp(runtime);
str.getClass();
regexp.str = str;
regexp.options = RegexpOptions.fromJoniOptions(pattern.getOptions());
regexp.pattern = pattern;
Expand Down Expand Up @@ -1031,7 +1028,6 @@ public final RubyRegexp regexpInitialize(ByteList bytes, Encoding enc, RegexpOpt
if (options.isEncodingNone()) setEncodingNone();

pattern = getRegexpFromCache(runtime, unescaped, enc, options);
bytes.getClass();
str = bytes;
return this;
}
Expand Down

0 comments on commit a0fc962

Please sign in to comment.