This repository has been archived on 2026-10-02. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
slashblade-allweapon/src/main/java
layue13 c3284030a3 perf(slashblade-allweapon): 加速弹体命中去重
原因 / Cause:
四类弹体每次实体扫描后都以 ArrayList.removeAll 进行已命中排除,候选与历史命中数增长时成员检查退化为线性。

修复 / Fix:
将仅作成员记录的 alreadyHitEntity 从 ArrayList 替换为 HashSet,保留原有 add、clear、addAll 与 removeAll 调用顺序。

性能收益 / Performance:
实体扫描结果排除已命中目标时,成员检查由线性查找降为均摊常数时间,降低多弹体和多目标场景的去重开销。

兼容性 / Compatibility:
不改变 AABB、selector、攻击顺序、命中冷却或弹体生命周期;集合未被迭代,命中列表的顺序和重复值不参与行为。

验证 / Validation:
Java 25 下执行 Gradle 9.4.0 build --no-daemon --console=plain 成功(test 为 NO-SOURCE)。

Refs #1
2026-09-05 16:12:44 +08:00
..
2026-06-30 04:05:01 +08:00