Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
668d632c
Commit
668d632c
authored
Jan 03, 2019
by
KOBAYASHI Shuji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pack: Remove redundant float check in pack_utf8()
The argument is converted to fixnum before calling.
parent
3e59f25e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
8 deletions
+0
-8
mrbgems/mruby-pack/src/pack.c
mrbgems/mruby-pack/src/pack.c
+0
-8
No files found.
mrbgems/mruby-pack/src/pack.c
View file @
668d632c
...
@@ -457,11 +457,6 @@ pack_utf8(mrb_state *mrb, mrb_value o, mrb_value str, mrb_int sidx, long count,
...
@@ -457,11 +457,6 @@ pack_utf8(mrb_state *mrb, mrb_value o, mrb_value str, mrb_int sidx, long count,
int
len
=
0
;
int
len
=
0
;
uint32_t
c
=
0
;
uint32_t
c
=
0
;
#ifndef MRB_WITHOUT_FLOAT
if
(
mrb_float_p
(
o
))
{
goto
range_error
;
}
#endif
c
=
(
uint32_t
)
mrb_fixnum
(
o
);
c
=
(
uint32_t
)
mrb_fixnum
(
o
);
/* Unicode character */
/* Unicode character */
...
@@ -489,9 +484,6 @@ pack_utf8(mrb_state *mrb, mrb_value o, mrb_value str, mrb_int sidx, long count,
...
@@ -489,9 +484,6 @@ pack_utf8(mrb_state *mrb, mrb_value o, mrb_value str, mrb_int sidx, long count,
len
=
4
;
len
=
4
;
}
}
else
{
else
{
#ifndef MRB_WITHOUT_FLOAT
range_error:
#endif
mrb_raise
(
mrb
,
E_RANGE_ERROR
,
"pack(U): value out of range"
);
mrb_raise
(
mrb
,
E_RANGE_ERROR
,
"pack(U): value out of range"
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment