fix: use Contains instead of HasPrefix for delivery repo detection#381
fix: use Contains instead of HasPrefix for delivery repo detection#381qiuzhiqian merged 1 commit intodevelop/intranet-updatefrom
Conversation
The delivery:// scheme may not always appear at the beginning of the source string, so using Contains is more robust for detecting delivery repositories.
|
CLA Assistant Lite bot: |
deepin pr auto review针对这段 1. 逻辑与功能审查 (严重)
2. 代码质量与规范
3. 性能分析
4. 安全性审查
总结与改进建议结论:此修改引入了逻辑 Bug,降低了代码性能,必须修复。 建议修改代码(恢复原逻辑并添加注释): func (m *UpdatePlatformManager) HasDeliveryRepo() bool {
for _, repo := range m.repoInfos {
// 使用 HasPrefix 确保只匹配以 delivery:// 开头的源地址,避免误匹配路径中包含该字符串的情况
if strings.HasPrefix(repo.Source, "delivery://") {
return true
}
}
return false
} |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: electricface, qiuzhiqian The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
The delivery:// scheme may not always appear at the beginning of the source string, so using Contains is more robust for detecting delivery repositories.