summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--string.c10
2 files changed, 8 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index e54de23..cafd1e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Mon Apr 21 18:19:35 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (coderange_scan): remove unused logic.
+
+ * string.c (rb_str_coderange_scan_restartable): ditto.
+
Mon Apr 21 14:11:48 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/stringio/stringio.c (strio_putc): fix for non-ascii
diff --git a/string.c b/string.c
index 021e135..7150791 100644
--- a/string.c
+++ b/string.c
@@ -328,9 +328,6 @@ coderange_scan(const char *p, long len, rb_encoding *enc)
}
}
}
- if (e < p) {
- return ENC_CODERANGE_BROKEN;
- }
return ENC_CODERANGE_VALID;
}
@@ -342,9 +339,6 @@ coderange_scan(const char *p, long len, rb_encoding *enc)
}
p += MBCLEN_CHARFOUND_LEN(ret);
}
- if (e < p) {
- return ENC_CODERANGE_BROKEN;
- }
return ENC_CODERANGE_VALID;
}
@@ -383,7 +377,7 @@ rb_str_coderange_scan_restartable(const char *s, const char *e, rb_encoding *enc
}
}
}
- *cr = e < p ? ENC_CODERANGE_BROKEN: ENC_CODERANGE_VALID;
+ *cr = ENC_CODERANGE_VALID;
return p - s;
}
else {
@@ -395,7 +389,7 @@ rb_str_coderange_scan_restartable(const char *s, const char *e, rb_encoding *enc
}
p += MBCLEN_CHARFOUND_LEN(ret);
}
- *cr = e < p ? ENC_CODERANGE_BROKEN: ENC_CODERANGE_VALID;
+ *cr = ENC_CODERANGE_VALID;
return p - s;
}
}