summaryrefslogtreecommitdiff
path: root/ext/socket
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-09 10:52:55 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-09 10:52:55 +0000
commit48de4753d1b376953676463ceddf75c303acdd94 (patch)
tree6f0f3f75fb62f300dca10d3e29437f17dd8bf2b2 /ext/socket
parentfd9c7e8af11fb79fa61ad7c462ff47e2ccd54486 (diff)
* ext/socket/option.c (sockopt_initialize): argument conversion
reordered. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket')
-rw-r--r--ext/socket/option.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/ext/socket/option.c b/ext/socket/option.c
index 0b461f174a..3d7243e6e0 100644
--- a/ext/socket/option.c
+++ b/ext/socket/option.c
@@ -37,14 +37,13 @@ optname_to_sym(int level, int optname)
static VALUE
sockopt_initialize(VALUE self, VALUE vfamily, VALUE vlevel, VALUE voptname, VALUE data)
{
- int family;
- int level;
+ int family = family_arg(vfamily);
+ int level = level_arg(vlevel);
+ int optname = optname_arg(level, voptname);
StringValue(data);
- level = level_arg(vlevel);
- family = family_arg(vfamily);
rb_ivar_set(self, rb_intern("family"), INT2NUM(family));
rb_ivar_set(self, rb_intern("level"), INT2NUM(level));
- rb_ivar_set(self, rb_intern("optname"), INT2NUM(optname_arg(level, voptname)));
+ rb_ivar_set(self, rb_intern("optname"), INT2NUM(optname));
rb_ivar_set(self, rb_intern("data"), data);
return self;
}