repo.or.cz
/
mruby.git
/
commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
raw
|
patch
|
inline
|
side by side
(parent:
7c02e17
)
variable.c (iv_size): refactor the function
author
Yukihiro "Matz" Matsumoto
<
[email protected]
>
Tue, 27 May 2025 01:16:12 +0000
(27 10:16 +0900)
committer
Yukihiro "Matz" Matsumoto
<
[email protected]
>
Tue, 27 May 2025 01:16:12 +0000
(27 10:16 +0900)
Along with removing an obsolete comment line.
src/variable.c
patch
|
blob
|
blame
|
history
diff --git
a/src/variable.c
b/src/variable.c
index
1208304
..
e7c53d3
100644
(file)
--- a/
src/variable.c
+++ b/
src/variable.c
@@
-192,12
+192,10
@@
iv_foreach(mrb_state *mrb, iv_tbl *t, mrb_iv_foreach_func *func, void *p)
}
/* Get the size of the instance variable table. */
-/* Size is approximated by the allocated table size. */
static size_t
iv_size(mrb_state *mrb, iv_tbl *t)
{
- if (t == NULL) return 0;
- return (size_t)t->size;
+ return t ? t->size : 0;
}
/* Copy the instance variable table. */