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
fb49a943
Commit
fb49a943
authored
Sep 23, 2018
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename `tr_pattern_free()` to `tr_free_pattern()`.
parent
78195eb2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
mrbgems/mruby-string-ext/src/string.c
mrbgems/mruby-string-ext/src/string.c
+7
-7
No files found.
mrbgems/mruby-string-ext/src/string.c
View file @
fb49a943
...
...
@@ -252,7 +252,7 @@ struct tr_pattern {
};
static
void
tr_
pattern_free
(
mrb_state
*
mrb
,
struct
tr_pattern
*
pat
)
tr_
free_pattern
(
mrb_state
*
mrb
,
struct
tr_pattern
*
pat
)
{
while
(
pat
)
{
struct
tr_pattern
*
p
=
pat
->
next
;
...
...
@@ -281,7 +281,7 @@ tr_parse_pattern(mrb_state *mrb, struct tr_pattern *ret, const mrb_value v_patte
pat1
=
(
struct
tr_pattern
*
)
mrb_malloc_simple
(
mrb
,
sizeof
(
struct
tr_pattern
)
+
2
);
if
(
pat1
==
NULL
&&
ret
)
{
nomem:
tr_
pattern_free
(
mrb
,
ret
);
tr_
free_pattern
(
mrb
,
ret
);
mrb_exc_raise
(
mrb
,
mrb_obj_value
(
mrb
->
nomem_err
));
return
NULL
;
/* not reached */
}
...
...
@@ -419,8 +419,8 @@ str_tr(mrb_state *mrb, mrb_value str, mrb_value p1, mrb_value p2, mrb_bool squee
}
}
tr_
pattern_free
(
mrb
,
pat
);
if
(
rep
)
tr_
pattern_free
(
mrb
,
rep
);
tr_
free_pattern
(
mrb
,
pat
);
if
(
rep
)
tr_
free_pattern
(
mrb
,
rep
);
RSTR_SET_LEN
(
RSTRING
(
str
),
len
);
RSTRING_PTR
(
str
)[
len
]
=
0
;
...
...
@@ -579,7 +579,7 @@ str_squeeze(mrb_state *mrb, mrb_value str, mrb_value v_pat)
lastch
=
s
[
i
];
}
}
tr_
pattern_free
(
mrb
,
pat
);
tr_
free_pattern
(
mrb
,
pat
);
RSTR_SET_LEN
(
RSTRING
(
str
),
len
);
RSTRING_PTR
(
str
)[
len
]
=
0
;
...
...
@@ -656,7 +656,7 @@ str_delete(mrb_state *mrb, mrb_value str, mrb_value v_pat)
i
--
;
}
}
tr_
pattern_free
(
mrb
,
pat
);
tr_
free_pattern
(
mrb
,
pat
);
RSTR_SET_LEN
(
RSTRING
(
str
),
len
);
RSTRING_PTR
(
str
)[
len
]
=
0
;
...
...
@@ -718,7 +718,7 @@ mrb_str_count(mrb_state *mrb, mrb_value str)
if
(
n
>=
0
)
count
++
;
}
tr_
pattern_free
(
mrb
,
pat
);
tr_
free_pattern
(
mrb
,
pat
);
return
mrb_fixnum_value
(
count
);
}
...
...
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