summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-08 08:36:43 +0000
committerduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-08 08:36:43 +0000
commitd9c6135c5bf540055ec76e27fef3f4a66057cf70 (patch)
tree6d9ea2e03db5b2b2e6d25324356872d258fa4e66
parent7d0b7fb4cf5790d42051d03933a3a3abf6ea0d1c (diff)
string.c: removed unused variable
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--string.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index f8e3668ac5c..80a682a2744 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Tue Dec 8 17:36:36 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * string.c: removed unused variable
+
Tue Dec 8 16:23:40 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* enumerator.c (lazy_grep_v): add Enumerator::Lazy#grep_v as well
diff --git a/string.c b/string.c
index a9fb0053670..d34359f328b 100644
--- a/string.c
+++ b/string.c
@@ -4545,8 +4545,7 @@ str_gsub(int argc, VALUE *argv, VALUE str, int bang)
{
VALUE pat, val = Qnil, repl, match, match0 = Qnil, dest, hash = Qnil;
struct re_registers *regs;
- long beg, n;
- long beg0, end0;
+ long beg, beg0, end0;
long offset, blen, slen, len, last;
enum {STR, ITER, MAP} mode = STR;
char *sp, *cp;
@@ -4582,7 +4581,6 @@ str_gsub(int argc, VALUE *argv, VALUE str, int bang)
}
offset = 0;
- n = 0;
blen = RSTRING_LEN(str) + 30; /* len + margin */
dest = rb_str_buf_new(blen);
sp = RSTRING_PTR(str);
@@ -4593,8 +4591,6 @@ str_gsub(int argc, VALUE *argv, VALUE str, int bang)
ENC_CODERANGE_SET(dest, rb_enc_asciicompat(str_enc) ? ENC_CODERANGE_7BIT : ENC_CODERANGE_VALID);
do {
- n++;
-
match = rb_backref_get();
regs = RMATCH_REGS(match);
if (RB_TYPE_P(pat, T_STRING)) {