Skip to content

Commit f9c7db0

Browse files
fix: resolve conflict markers and fix O(n²) edge case in parser_cef
The feature commit accidentally committed unresolved stash conflict markers into parser_cef.py, making it invalid Python. Resolves to _parse_cef_ext(). Also fixes an O(n²) scan in _parse_cef_ext: when the key scanner reaches end-of-string with no '=' remaining, the old code rewound to start+1 and rescanned — degenerating to quadratic on '='-free input. Now breaks out of the loop immediately. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 31e933d commit f9c7db0

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

package/shared/pylib/parser_cef.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ class overlapped the trailing whitespace delimiter, so the engine could split
3535
while p < n and data[p] != "=" and not data[p].isspace():
3636
p += 1
3737
if p == start or p >= n or data[p] != "=":
38-
p = start + 1 # not a valid "key=" here; advance and retry
38+
if p >= n:
39+
break # no '=' anywhere ahead; nothing more to find
40+
p = p + 1 # skip the space or bare '='
3941
continue
4042
key = data[start:p]
4143
p += 1 # skip '='
@@ -81,11 +83,7 @@ def parse(self, log_message):
8183
try:
8284
data = log_message.get_as_str(".metadata.cef.ext", "")
8385

84-
<<<<<<< Updated upstream
85-
rpairs = re.findall(r"([^=\s]+)=((?:\\=|[^=])+)(?:\s|$)", data)
86-
=======
8786
rpairs = _parse_cef_ext(data)
88-
>>>>>>> Stashed changes
8987
pairs = {}
9088
keys = []
9189
for p in rpairs:

0 commit comments

Comments
 (0)