mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-21 09:10:48 +00:00
Using std::string::starts_with (#9321)
* Using std::string::starts_with * Fixed error * Fixed error
This commit is contained in:
parent
0a75acaeff
commit
6c9991ae43
@ -224,7 +224,7 @@ void SettingsConstraints::setProfile(const String & profile_name, const Poco::Ut
|
||||
|
||||
for (const std::string & key : config_keys)
|
||||
{
|
||||
if (key == "profile" || 0 == key.compare(0, strlen("profile["), "profile[")) /// Inheritance of profiles from the current one.
|
||||
if (key == "profile" || key.starts_with("profile[")) /// Inheritance of profiles from the current one.
|
||||
setProfile(config.getString(elem + "." + key), config);
|
||||
else
|
||||
continue;
|
||||
|
@ -37,7 +37,7 @@ void Settings::setProfile(const String & profile_name, const Poco::Util::Abstrac
|
||||
{
|
||||
if (key == "constraints")
|
||||
continue;
|
||||
if (key == "profile" || 0 == key.compare(0, strlen("profile["), "profile[")) /// Inheritance of profiles from the current one.
|
||||
if (key == "profile" || key.starts_with("profile[")) /// Inheritance of profiles from the current one.
|
||||
setProfile(config.getString(elem + "." + key), config);
|
||||
else
|
||||
set(key, config.getString(elem + "." + key));
|
||||
|
@ -36,7 +36,8 @@ void RegionsHierarchiesDataProvider::discoverFilesWithCustomHierarchies()
|
||||
{
|
||||
std::string candidate_basename = dir_it.path().getBaseName();
|
||||
|
||||
if ((0 == candidate_basename.compare(0, basename.size(), basename)) && (candidate_basename.size() > basename.size() + 1)
|
||||
if (candidate_basename.starts_with(basename)
|
||||
&& (candidate_basename.size() > basename.size() + 1)
|
||||
&& (candidate_basename[basename.size()] == '_'))
|
||||
{
|
||||
const std::string suffix = candidate_basename.substr(basename.size() + 1);
|
||||
|
Loading…
Reference in New Issue
Block a user