Commit e952e9b2 authored by Julien Cabieces's avatar Julien Cabieces

Fix several C++ comment

parent f7f9c007
......@@ -198,13 +198,11 @@ private:
OGRFieldType fieldType = feature.ogr().GetFieldDefnRef(iField)->GetType();
for (auto type : typeFilter)
if (fieldType == type)
{
std::string tmpKey = "ref.vector.field." + key.substr(0, end - key.begin());
AddChoice(tmpKey, item);
break;
}
if (std::find(typeFilter.begin(), typeFilter.end(), fieldType) != std::end(typeFilter))
{
std::string tmpKey = "ref.vector.field." + key.substr(0, end - key.begin());
AddChoice(tmpKey, item);
}
}
}
}
......
......@@ -65,13 +65,11 @@ void VectorPrediction<RegressionMode>::DoUpdateParameters()
std::transform(key.begin(), key.end(), key.begin(), tolower);
auto fieldType = fieldDefn->GetType();
for (auto type : typeFilter)
if (fieldType == type)
{
std::string tmpKey = "feat." + key;
AddChoice(tmpKey, item);
break;
}
if (std::find(typeFilter.begin(), typeFilter.end(), fieldType) != std::end(typeFilter))
{
std::string tmpKey = "feat." + key;
AddChoice(tmpKey, item);
}
}
}
}
......
......@@ -565,29 +565,29 @@ public:
/**
* Set vector data name from which we choose the fields for a FieldParameter
* \in key The parameter key (must be a FieldParameter)
* \in vectorData vector data name
* \param[in] key The parameter key (must be a FieldParameter)
* \param[in] vectorData vector data name
*/
void SetVectorData(std::string const& key, std::string const& vectorData );
/**
* Set list of allowed field types for a FieldParameter
* \in key The parameter key (must be a FieldParameter)
* \in typeFilter List of allowed types
* \param[in] key The parameter key (must be a FieldParameter)
* \param[in] typeFilter List of allowed types
*/
void SetTypeFilter(std::string const& key, FieldParameter::TypeFilterType const& typeFilter );
/**
* Get list of allowed field types for a FieldParameter
* \in key The parameter key (must be a FieldParameter)
* \param[in] key The parameter key (must be a FieldParameter)
* \return List of allowed types
*/
const FieldParameter::TypeFilterType& GetTypeFilter(std::string const& key );
/**
* Set raster data name from which we choose the bands for a BandParameter
* \in key The parameter key (must be a BandParameter)
* \in rasterData raster data name
* \param[in] key The parameter key (must be a BandParameter)
* \param[in] rasterData raster data name
*/
void SetRasterData(std::string const& key, std::string const& rasterData );
......
......@@ -56,9 +56,9 @@ public:
}
/** Set raster data name from which we choose the fields */
void SetRasterData(const std::string& rasterData)
void SetRasterData(std::string rasterData)
{
m_RasterData = rasterData;
m_RasterData = std::move(rasterData);
}
/** Get raster data name from which we choose the fields */
......@@ -69,14 +69,10 @@ public:
protected:
/** Constructor */
BandParameter()
{
}
BandParameter() = default;
/** Destructor */
~BandParameter() override
{
}
~BandParameter() override = default;
std::string m_RasterData;
......
......@@ -58,9 +58,9 @@ public:
}
/** Set vector data name from which we choose the fields */
void SetVectorData(const std::string& vectorData)
void SetVectorData(std::string vectorData)
{
m_VectorData = vectorData;
m_VectorData = std::move(vectorData);
}
/** Get vector data name from which we choose the fields */
......@@ -70,9 +70,9 @@ public:
}
/** Set list of allowed field types */
void SetTypeFilter(const TypeFilterType& typeFilter)
void SetTypeFilter(TypeFilterType typeFilter)
{
m_TypeFilter = typeFilter;
m_TypeFilter = std::move(typeFilter);
}
/** Get list of allowed field types */
......@@ -83,14 +83,10 @@ public:
protected:
/** Constructor */
FieldParameter()
{
}
FieldParameter() = default;
/** Destructor */
~FieldParameter() override
{
}
~FieldParameter() override = default;
std::string m_VectorData;
TypeFilterType m_TypeFilter;
......
......@@ -261,7 +261,7 @@ int main(int argc, char* argv[])
for (auto k : key_list)
values += k + ";";
if (values.size())
if (!values.empty())
values.pop_back();
dFile << "|" << values;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment