Unverified Commit 31cc8573 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #4423 from shuujii/use-mrb_fixnum_to_str-instead-of-Fixnum-to_s

Use `mrb_fixnum_to_str()` instead of `Fixnum#to_s`
parents 2b1c4e9a 0ccb058b
......@@ -38,6 +38,7 @@
#include "mruby/array.h"
#include "mruby/class.h"
#include "mruby/data.h"
#include "mruby/numeric.h"
#include "mruby/string.h"
#include "mruby/variable.h"
#include "error.h"
......@@ -140,7 +141,7 @@ mrb_addrinfo_getaddrinfo(mrb_state *mrb, mrb_value klass)
if (mrb_string_p(service)) {
servname = mrb_str_to_cstr(mrb, service);
} else if (mrb_fixnum_p(service)) {
servname = mrb_str_to_cstr(mrb, mrb_funcall(mrb, service, "to_s", 0));
servname = RSTRING_PTR(mrb_fixnum_to_str(mrb, service, 10));
} else if (mrb_nil_p(service)) {
servname = NULL;
} else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment