This is an archive of the discontinued LLVM Phabricator instance.

[clang] NFC: Use flush() idiomatically
ClosedPublic

Authored by kbobyrev on Jan 26 2022, 6:59 AM.

Details

Summary

Using both raw_ostream::flush() and raw_ostream::str() consecutively is
redundant. The alternatives are:

  • Use raw_ostream::str() without raw_ostream::flush()
  • Use raw_ostream::flush() and then use the destination for raw_ostream writer

The latter is more idiomatic, so the fix resolves this particular case in its
favor.

Diff Detail

Event Timeline

kbobyrev requested review of this revision.Jan 26 2022, 6:59 AM
kbobyrev created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJan 26 2022, 6:59 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
kadircet accepted this revision.Jan 26 2022, 9:23 AM
This revision is now accepted and ready to land.Jan 26 2022, 9:23 AM
This revision was landed with ongoing or failed builds.Jan 26 2022, 9:25 AM
This revision was automatically updated to reflect the committed changes.