Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve the duplicate registration key issue #142

Merged
merged 2 commits into from
Jul 26, 2024

Conversation

zhengjian526
Copy link
Collaborator

Resolve the duplicate registration key issue

Copy link

Code Coverage Report
for detail, goto summary download Artifacts

Filename                    Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
client_util.hpp                     4                 0   100.00%          25                 4    84.00%           4                 2    50.00%
codec.h                             4                 0   100.00%          24                 0   100.00%           0                 0         -
connection.h                       40                 4    90.00%         380                93    75.53%          72                37    48.61%
io_service_pool.h                   5                 0   100.00%          32                 1    96.88%          12                 1    91.67%
md5.hpp                            19                 2    89.47%         127                 8    93.70%          24                 0   100.00%
router.h                           19                 1    94.74%         144                25    82.64%           4                 1    75.00%
rpc_client.hpp                     74                 6    91.89%         669               114    82.96%         132                52    60.61%
rpc_server.h                       28                 3    89.29%         205                20    90.24%          44                10    77.27%
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                             193                16    91.71%        1606               265    83.50%         292               103    64.73%

@@ -50,16 +50,34 @@ class router : asio::noncopyable {
template <bool is_pub = false, typename Function>
void register_handler(std::string const &name, Function f, bool pub = false) {
uint32_t key = MD5::MD5Hash32(name.data());
key2func_name_.emplace(key, name);
return register_nonmember_func<is_pub>(key, std::move(f));
try {
Copy link
Owner

Choose a reason for hiding this comment

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

这里不需要try,让用户去try

Copy link

Code Coverage Report
for detail, goto summary download Artifacts

Filename                    Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
client_util.hpp                     4                 0   100.00%          25                 4    84.00%           4                 2    50.00%
codec.h                             4                 0   100.00%          24                 0   100.00%           0                 0         -
connection.h                       40                 4    90.00%         380                93    75.53%          72                37    48.61%
io_service_pool.h                   5                 0   100.00%          32                 1    96.88%          12                 1    91.67%
md5.hpp                            19                 2    89.47%         127                 8    93.70%          24                 0   100.00%
router.h                           19                 1    94.74%         144                25    82.64%           4                 1    75.00%
rpc_client.hpp                     74                 6    91.89%         669               114    82.96%         132                52    60.61%
rpc_server.h                       28                 3    89.29%         205                20    90.24%          44                10    77.27%
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                             193                16    91.71%        1606               265    83.50%         292               103    64.73%

Copy link
Owner

@qicosmos qicosmos left a comment

Choose a reason for hiding this comment

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

LGTM

@qicosmos qicosmos merged commit 35761ed into qicosmos:master Jul 26, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants