Skip to content

Remove LevEditType::Keep variant#27

Merged
encounter merged 1 commit intoencounter:mainfrom
NickCondron:keep
Jan 22, 2023
Merged

Remove LevEditType::Keep variant#27
encounter merged 1 commit intoencounter:mainfrom
NickCondron:keep

Conversation

@NickCondron
Copy link
Copy Markdown
Contributor

The variant was left unused leading to dead match branches and unsound logic. I removed the variant and tried to tidy up editops_from_cost_matrix. I think the code could be improved some more, but I wanted to stop here.

Comment on lines -514 to +513
let mut cur_op = LevEditType::Keep;
let mut cur_op = LevEditType::Replace;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the only change where I wasn't really sure on the semantics. Based on my reading of the code, the initial value of this variable doesn't really matter because it's always set on the first iteration of the following loop.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, initial value doesn't matter.

@encounter
Copy link
Copy Markdown
Owner

Thanks for the cleanup!

@encounter encounter merged commit 019493f into encounter:main Jan 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants