[cmake-developers] [patch] install cfbundles as directory

Ben Boeckel ben.boeckel at kitware.com
Wed Jul 9 11:23:02 EDT 2014


On Wed, Jul 09, 2014 at 11:09:01 -0400, Brad King wrote:
> > +      std::string targetNameBase = targetName.substr(0, targetName.find_first_of("/"));

Not that this is performance-sensitive region, but in the pursuit
removing bad patterns to avoid copy/paste issues in the future:

    std::string targetNameBase = targetName.resize(targetName.find('/'));

is better, though the resize might not be doable since there's a check
for npos that is necessary if the targetName doesn't have a slash in it.
The find_first_of(one_char_string) should definitely be find(one_char)
or find_first_of(one_char).

Of course, assuming this line survives to the final patch.

Thanks,

--Ben



More information about the cmake-developers mailing list