Page MenuHomePhabricator

[clang-format] Replace unordered_set with an array
ClosedPublic

Authored by krasimir on Jan 17 2018, 10:47 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

krasimir created this revision.Jan 17 2018, 10:47 AM
bkramer added inline comments.Jan 17 2018, 10:52 AM
lib/Format/Format.cpp
1424 ↗(On Diff #130213)

The ArrayRef doesn't own its contents, so this is a use-after-scope.

I'd prefer static constexpr llvm::StringLiteral FoundationIdentifiers[] = {

krasimir updated this revision to Diff 130223.Jan 17 2018, 11:12 AM
  • Address review comment
benhamilton accepted this revision.Jan 17 2018, 11:19 AM

Thanks, this is smarter.

This revision is now accepted and ready to land.Jan 17 2018, 11:19 AM
benhamilton added inline comments.Jan 17 2018, 11:21 AM
lib/Format/Format.cpp
1424 ↗(On Diff #130223)

Should we add a comment that this array must be sorted if someone adds a new entry?

krasimir updated this revision to Diff 130232.Jan 17 2018, 11:31 AM
  • Add comment
krasimir marked 2 inline comments as done.Jan 17 2018, 11:31 AM
This revision was automatically updated to reflect the committed changes.