Skip to content

Commit

Permalink
Refactor Module
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Sep 24, 2020
1 parent cb6d014 commit 18a67f3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/fizzy/module.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,14 @@ struct Module
// Types of globals defined in import section
std::vector<GlobalType> imported_global_types;

size_t get_function_count() const noexcept
{
return imported_function_types.size() + funcsec.size();
}

const FuncType& get_function_type(FuncIdx idx) const noexcept
{
assert(idx < imported_function_types.size() + funcsec.size());
assert(idx < get_function_count());

if (idx < imported_function_types.size())
return imported_function_types[idx];
Expand All @@ -58,11 +63,6 @@ struct Module
return typesec[type_idx];
}

size_t get_function_count() const noexcept
{
return imported_function_types.size() + funcsec.size();
}

size_t get_global_count() const noexcept
{
return imported_global_types.size() + globalsec.size();
Expand Down

0 comments on commit 18a67f3

Please sign in to comment.