Skip to content

Commit d812b4e

Browse files
authored
⚡ Bolt: Replace lambda with operator.itemgetter for event sorting (#144)
1 parent cc73fa7 commit d812b4e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/ledgermind/core/reasoning/enrichment/processor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import logging
2+
from operator import itemgetter
23
from typing import Any, Tuple, List
34
from .config import EnrichmentConfig
45

@@ -22,7 +23,8 @@ def get_batch_logs(proposal: Any, episodic_store: Any, config: EnrichmentConfig)
2223
found_ids = {e['id'] for e in events}
2324
missing_ids = [eid for eid in eids if eid not in found_ids]
2425

25-
events.sort(key=lambda x: x.get('timestamp', ''))
26+
# ⚡ Bolt: Replace lambda function with C-optimized operator.itemgetter for faster sorting
27+
events.sort(key=itemgetter('timestamp'))
2628

2729
total_available = len(events)
2830
included_lines = []

0 commit comments

Comments
 (0)