perf(methods): 通过移除不必要的 self 参数优化方法签名
在包括 chat、plugin_system、schedule 和 mais4u 在内的多个模块中,消除冗余的实例引用。此次改动将无需访问实例状态的实用函数转换为静态方法,从而提升了内存效率,并使方法依赖关系更加清晰。
This commit is contained in:
@@ -162,7 +162,8 @@ class DependencyManager:
|
||||
|
||||
return False, all_errors
|
||||
|
||||
def _normalize_dependencies(self, dependencies: Any) -> List[PythonDependency]:
|
||||
@staticmethod
|
||||
def _normalize_dependencies(dependencies: Any) -> List[PythonDependency]:
|
||||
"""将依赖列表标准化为PythonDependency对象"""
|
||||
normalized = []
|
||||
|
||||
@@ -191,7 +192,8 @@ class DependencyManager:
|
||||
|
||||
return normalized
|
||||
|
||||
def _check_single_dependency(self, dep: PythonDependency) -> bool:
|
||||
@staticmethod
|
||||
def _check_single_dependency(dep: PythonDependency) -> bool:
|
||||
"""检查单个依赖是否满足要求"""
|
||||
|
||||
def _try_check(import_name: str) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user