Skip to content

Commit a7cf93a

Browse files
authored
[fix] an off by one error in the upper bound of rfind()
1 parent dda8aa1 commit a7cf93a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/partial_json_parser/core/myelin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def truncate_before_last_key_start(container_start: int, last_string_end: int, s
120120
# { "k
121121
return json_string[: stack[-1][0] + 1], join_closing_tokens(stack)
122122

123-
last_comma = json_string.rfind(",", max(stack[-1][0], last_string_end) + 1, last_string_start - 1)
123+
last_comma = json_string.rfind(",", max(stack[-1][0], last_string_end) + 1, last_string_start)
124124
if last_comma != -1:
125125
# { "key": "v", "k
126126
# { "key": 123, "k

0 commit comments

Comments
 (0)