使用static_pointer_cast优化性能

This commit is contained in:
xia-chu
2023-04-28 22:04:38 +08:00
parent cdf97e7605
commit d2349f01bd
23 changed files with 59 additions and 57 deletions

View File

@@ -120,7 +120,7 @@ inline void ShellSession::pleaseInputPasswd() {
_loginInterceptor=nullptr;
};
weak_ptr<ShellSession> weakSelf = dynamic_pointer_cast<ShellSession>(shared_from_this());
weak_ptr<ShellSession> weakSelf = static_pointer_cast<ShellSession>(shared_from_this());
Broadcast::AuthInvoker invoker = [weakSelf,onAuth](const string &errMessage){
auto strongSelf = weakSelf.lock();
if(!strongSelf){