Skip to content

Remove unreachable branch in filename_from_path#6480

Open
cuiweixie wants to merge 1 commit intoodin-lang:masterfrom
cuiweixie:deadcode/filename-from-path
Open

Remove unreachable branch in filename_from_path#6480
cuiweixie wants to merge 1 commit intoodin-lang:masterfrom
cuiweixie:deadcode/filename-from-path

Conversation

@cuiweixie
Copy link
Contributor

In filename_from_path, the if (i > 0) block after the i >= 0 early return can never run: when control reaches it, string_extension_position returned a negative value, so i > 0 is always false. Remove the dead code; behavior is unchanged.

After handling string_extension_position >= 0, i is negative, so the
following i > 0 block was never executed.
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.

1 participant