Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

move is_string_valid_name to cpp file #9445

Merged
merged 1 commit into from
Aug 26, 2020

Conversation

huangminghuang
Copy link
Contributor

@huangminghuang huangminghuang commented Aug 25, 2020

Change Description

eosio::chain::is_string_valid_name() is static function in the header file which caused it be generated in every translation units include that header file. This PR fixes the problem.

Change Type

Select ONE

  • Documentation
  • Stability bug fix
  • Other
  • Other - special case

Consensus Changes

  • Consensus Changes

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions


return true;
}
bool is_string_valid_name(std::string_view str);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about making it a constexpr instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make it constexpr only make if it is called with the input parameter can be known at compile time. I don't see any of callers of the function meet that criteria except those in unit tests.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, use case is likely not there.

@huangminghuang huangminghuang merged commit 2795d45 into develop Aug 26, 2020
@jeffreyssmith2nd jeffreyssmith2nd deleted the huangminghuang/fix-is_string_valid_name branch August 26, 2020 13:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants