Skip to content

Commit 504bc69

Browse files
authored
If tags have same name, prioritize matching based on length (not lowest error)
Fix issue #49 and #47
1 parent 37b7b7b commit 504bc69

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/SplitCode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2257,7 +2257,7 @@ struct SplitCode {
22572257
if (updated_name_id != name_id_curr) {
22582258
return false; // multiple tags of different names
22592259
}
2260-
if (updated_error >= error_prev) { // Choose smallest error first when deciding if to update to larger k
2260+
if (true /* updated_error >= error_prev */) { // Edit: Always update to larger k if tags have same name (regardless of mismatch error)
22612261
updated_tag_id = tag_id_curr;
22622262
updated_k = curr_k; // Update to larger k
22632263
updated_error = error_prev;

0 commit comments

Comments
 (0)