This is an archive of the discontinued LLVM Phabricator instance.

libcxx: use early returns
ClosedPublic

Authored by joerg on Feb 18 2021, 6:34 AM.

Details

Reviewers
ldionne
Group Reviewers
Restricted Project
Commits
rGa77e91801604: libcxx: use early returns

Diff Detail

Event Timeline

joerg requested review of this revision.Feb 18 2021, 6:34 AM
joerg created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 18 2021, 6:34 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript

This looks correct, but I'm not sure what we gain from making this change?

libcxx/src/filesystem/operations.cpp
1065

I found it easier to understand when we unconditionally returned false at the end of the function TBH. Now, I have to go and figure out what ErrorHandler<bool>::report() returns when I'm just glancing at the function.

joerg added inline comments.Feb 18 2021, 6:56 AM
libcxx/src/filesystem/operations.cpp
1065

But you already have to know that for the two uses before in this function. Now it is at least consistent.

ldionne accepted this revision.Feb 18 2021, 7:43 AM

LGTM. Please wait for CI to finish and ship it.

CI is successful when this is green:

libcxx/src/filesystem/operations.cpp
1065

Agreed.

This revision is now accepted and ready to land.Feb 18 2021, 7:43 AM
This revision was automatically updated to reflect the committed changes.