Skip to content

Commit 18a67f3

Browse files
committed
Refactor Module
1 parent cb6d014 commit 18a67f3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Diff for: lib/fizzy/module.hpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,14 @@ struct Module
4545
// Types of globals defined in import section
4646
std::vector<GlobalType> imported_global_types;
4747

48+
size_t get_function_count() const noexcept
49+
{
50+
return imported_function_types.size() + funcsec.size();
51+
}
52+
4853
const FuncType& get_function_type(FuncIdx idx) const noexcept
4954
{
50-
assert(idx < imported_function_types.size() + funcsec.size());
55+
assert(idx < get_function_count());
5156

5257
if (idx < imported_function_types.size())
5358
return imported_function_types[idx];
@@ -58,11 +63,6 @@ struct Module
5863
return typesec[type_idx];
5964
}
6065

61-
size_t get_function_count() const noexcept
62-
{
63-
return imported_function_types.size() + funcsec.size();
64-
}
65-
6666
size_t get_global_count() const noexcept
6767
{
6868
return imported_global_types.size() + globalsec.size();

0 commit comments

Comments
 (0)