erp scan: erpnext-0001/0002, ofbiz-0001/0002; odoo CLEAN; 4/4 PASS

erpnext-0001: BOM.get_children list dedup O(B^2) MEDIUM 4x
erpnext-0002: serial_batch_bundle serial/batch dedup O(N^2) HIGH 45x
ofbiz-0001: PaymentGatewayServices processList LinkedList O(N^2) HIGH 45x
ofbiz-0002: OrderReturnServices/OrderReadHelper payment dedup O(N^2) MEDIUM 36x
odoo: CLEAN (consistent set/frozenset/OrderedSet usage throughout)
This commit is contained in:
russell@unturf.com 2026-03-30 15:24:39 -04:00
parent 15db2a0269
commit 896a29f83b
9 changed files with 538 additions and 0 deletions

View file

@ -0,0 +1,24 @@
# UNDF: UNDF-2026-000000862
--- a/erpnext/manufacturing/doctype/bom/bom.py
+++ b/erpnext/manufacturing/doctype/bom/bom.py
@@ -920,11 +920,13 @@
count = 0
if not bom_list:
bom_list = []
- if self.name not in bom_list:
+ bom_set = set(bom_list)
+
+ if self.name not in bom_set:
bom_list.append(self.name)
+ bom_set.add(self.name)
while count < len(bom_list):
for child_bom in _get_children(bom_list[count]):
- if child_bom not in bom_list:
+ if child_bom not in bom_set:
bom_list.append(child_bom)
+ bom_set.add(child_bom)
count += 1
bom_list.reverse()
return bom_list