summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-04 01:23:58 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-04 01:23:58 +0000
commitb259e449d14e47e225960ec0fce12a5b2c1bec6d (patch)
treebfd3f3e3fcfcc3bb1769177ece8d2f229006cb61 /random.c
parent3a633b812e3676d4a1c8f20426d0354be530e056 (diff)
* random.c (rand_init): remove useless assignment.
* re.c (update_char_offset): remove unused variable. * re.c (read_escaped_byte): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'random.c')
-rw-r--r--random.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/random.c b/random.c
index 9044c77432..c630e9b6b5 100644
--- a/random.c
+++ b/random.c
@@ -415,7 +415,7 @@ rand_init(struct MT *mt, VALUE vseed)
}
else {
if (blen > MT_MAX_STATE * SIZEOF_INT32 / SIZEOF_BDIGITS)
- blen = (len = MT_MAX_STATE) * SIZEOF_INT32 / SIZEOF_BDIGITS;
+ blen = MT_MAX_STATE * SIZEOF_INT32 / SIZEOF_BDIGITS;
len = roomof((int)blen * SIZEOF_BDIGITS, SIZEOF_INT32);
}
/* allocate ints for init_by_array */
@@ -1066,7 +1066,7 @@ random_rand(int argc, VALUE *argv, VALUE obj)
v = Qnil;
}
else if (TYPE(vmax) != T_FLOAT && (v = rb_check_to_integer(vmax, "to_int"), !NIL_P(v))) {
- v = rand_int(&rnd->mt, vmax = v, 1);
+ v = rand_int(&rnd->mt, v, 1);
}
else if (v = rb_check_to_float(vmax), !NIL_P(v)) {
double max = float_value(v);