Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusion with build_version.cc.in:AddProperty function. #13388

Open
ksolana opened this issue Feb 8, 2025 · 0 comments
Open

Confusion with build_version.cc.in:AddProperty function. #13388

ksolana opened this issue Feb 8, 2025 · 0 comments

Comments

@ksolana
Copy link

ksolana commented Feb 8, 2025

As per the comment the props map is modified only when "@:" is not found. But then at != colon + 1 seemingly indicates it is searching for ":@"? Is the comment incorrect or the code. I'm confused.

namespace ROCKSDB_NAMESPACE {
static void AddProperty(std::unordered_map<std::string, std::string> *props, const std::string& name) {
  size_t colon = name.find(":");
  if (colon != std::string::npos && colon > 0 && colon < name.length() - 1) {
    // If we found a "@:", then this property was a build-time substitution that failed.  Skip it
    size_t at = name.find("@", colon);
    if (at != colon + 1) {
      // Everything before the colon is the name, after is the value
      (*props)[name.substr(0, colon)] = name.substr(colon + 1);
    }
  }
}
ksolana added a commit to ksolana/rocksdb that referenced this issue Feb 8, 2025
Also simplify comment as noted in facebook#13388
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant