File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
ext/java/org/jruby/ext/stringio Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ public Encoding getEncoding() {
149149 }
150150
151151 RubyString string = ptr .string ;
152- if (string != null && ! string . isNil () ) {
152+ if (string != null ) {
153153 return string .getEncoding ();
154154 }
155155
@@ -2210,12 +2210,13 @@ private void checkWritable() {
22102210 }
22112211
22122212 private void checkModifiable () {
2213- if (getPtr ().string == null || getPtr ().string .isNil ()) {
2213+ final RubyString string = getPtr ().string ;
2214+ if (string == null ) {
22142215 /* Null device StringIO */
2215- } else if (getPtr (). string .isFrozen ()) {
2216+ } else if (string .isFrozen ()) {
22162217 throw getRuntime ().newIOError ("not modifiable string" );
22172218 } else {
2218- getPtr (). string .modify ();
2219+ string .modify ();
22192220 }
22202221 }
22212222
You can’t perform that action at this time.
0 commit comments