baloghadamsoftware added inline comments.
================ Comment at: lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp:325 + std::string FullOption = + (llvm::Twine() + FullName + ":" + OptionName).str(); + ---------------- whisperity wrote: > baloghadamsoftware wrote: > > Is this the most efficient way to concatenate `StringRef`s? > > @baloghadamsoftware > > Is this the most efficient way to concatenate `StringRef`s? > > `Twine` is specifically designed for that, yes. > You can't evade the final "copy", although most likely there'll be a RVO > taking place. > > However, the *first* `Twine` could be initialised from the `FullName` > variable, as opposed to empty node. > And you could use single characters as characters, as opposed to strings, > i.e. `(Twine(FullName) + ':' + OptionName).str()`. The constructor `Twine(const StringRef &Str)` is implicit so `(FullName + ':' + OptionName).str()` results the same and is more readable. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57860/new/ https://reviews.llvm.org/D57860 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits