Skip to content

Remove unnecessary if#5172

Open
nlohmann wants to merge 1 commit into
developfrom
remove-if
Open

Remove unnecessary if#5172
nlohmann wants to merge 1 commit into
developfrom
remove-if

Conversation

@nlohmann
Copy link
Copy Markdown
Owner

std::copy on an empty range is a defined no-op. The guard adds a branch and a second call to .size() for no benefit.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
@nlohmann nlohmann added the review needed It would be great if someone could review the proposed changes. label May 15, 2026
@github-actions github-actions Bot added the M label May 15, 2026
@nlohmann nlohmann added this to the Release 3.12.1 milestone May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

M review needed It would be great if someone could review the proposed changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant