#516 [ENGINE/Data] Sensitive keyword patterns should use frozenset
Description
Edit**Files:**
- engine/apps/executor.py:841
- engine/services/event_gateway_service.py:625
**Problem:** List literals for sensitive keywords created repeatedly in loops. Should be module-level frozenset for O(1) lookup.
**Current:**
```python
if any(s in key_lower for s in ["secret", "password", "token", "key", "auth"]):
```
**Fix:**
```python
# Module level
_SENSITIVE_KEY_PATTERNS = frozenset(["secret", "password", "token", "key", "auth"])
# In function
if any(s in key_lower for s in _SENSITIVE_KEY_PATTERNS):
```
**Impact:** Minor performance improvement, better code style.
Comments
Loading comments...
Context
Loading context...
Audit History
View AllLoading audit history...