summaryrefslogtreecommitdiff
path: root/ext/digest/digest.c
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-17 13:57:17 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-17 13:57:17 +0000
commit7bfdad3b62eb19c216baed90d4da5c6a6545fe8c (patch)
tree333c166f1f0813e4bb2ccb67838d81b6f3df6fbb /ext/digest/digest.c
parent441619b73c171bbd808d2bf9125c6bed29fddc74 (diff)
* ext/digest/digest.c (rb_digest_instance_digest)
(rb_digest_instance_hexdigest): Save a method call of reset() for a disposable clone. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/digest/digest.c')
-rw-r--r--ext/digest/digest.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/ext/digest/digest.c b/ext/digest/digest.c
index c415ec4..4f3b462 100644
--- a/ext/digest/digest.c
+++ b/ext/digest/digest.c
@@ -179,10 +179,7 @@ rb_digest_instance_digest(int argc, VALUE *argv, VALUE self)
value = rb_funcall(self, id_finish, 0);
rb_funcall(self, id_reset, 0);
} else {
- VALUE clone = rb_obj_clone(self);
-
- value = rb_funcall(clone, id_finish, 0);
- rb_funcall(clone, id_reset, 0);
+ value = rb_funcall(rb_obj_clone(self), id_finish, 0);
}
return value;
@@ -227,10 +224,7 @@ rb_digest_instance_hexdigest(int argc, VALUE *argv, VALUE self)
value = rb_funcall(self, id_finish, 0);
rb_funcall(self, id_reset, 0);
} else {
- VALUE clone = rb_obj_clone(self);
-
- value = rb_funcall(clone, id_finish, 0);
- rb_funcall(clone, id_reset, 0);
+ value = rb_funcall(rb_obj_clone(self), id_finish, 0);
}
return hexencode_str_new(value);