Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify add_suffix #3878

Merged
merged 1 commit into from Sep 8, 2022
Merged

Simplify add_suffix #3878

merged 1 commit into from Sep 8, 2022

Conversation

mguaypaq
Copy link
Member

@mguaypaq mguaypaq commented Sep 7, 2022

The strings are already concatenated by +, and os.path.join with a single string argument just returns it unchanged.

The strings are already concatenated by `+`, and `os.path.join` with a single string argument just returns it unchanged.
@mguaypaq mguaypaq added refactoring category: improves code structure without affecting user-facing functionality SCT API: image.py context: labels Sep 7, 2022
@mguaypaq mguaypaq added this to the 5.8 milestone Sep 7, 2022
@mguaypaq mguaypaq self-assigned this Sep 7, 2022
Copy link
Member

@joshuacwnewton joshuacwnewton left a comment

Choose a reason for hiding this comment

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

Yes, this makes perfect sense! os.path.join was doing nothing here. :)

Plus, any pathlike components should be contained entirely in stem, with suffix and ext not needing to use platform-specific path separators or anything like that, so regular old string concatenation is fine here.

@mguaypaq mguaypaq merged commit 6b1791b into master Sep 8, 2022
@mguaypaq mguaypaq deleted the mgp/add-suffix-no-join branch September 8, 2022 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring category: improves code structure without affecting user-facing functionality SCT API: image.py context:
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants