+ returning mapnik::parameter makes more sense in this context (?)

This commit is contained in:
artemp 2013-01-04 16:55:18 +00:00
parent 8e78bb3c20
commit e68a65db33

View file

@ -135,7 +135,7 @@ mapnik::value_holder get_params_by_key2(mapnik::parameters const& p, std::string
return pos->second;
}
mapnik::value_holder get_params_by_index(mapnik::parameters const& p, int index)
mapnik::parameter get_params_by_index(mapnik::parameters const& p, int index)
{
if (index < 0 || static_cast<unsigned>(index) > p.size())
{
@ -144,11 +144,10 @@ mapnik::value_holder get_params_by_index(mapnik::parameters const& p, int index)
}
parameters::const_iterator itr = p.begin();
parameters::const_iterator end = p.end();
std::advance(itr, index);
if (itr != p.end())
{
return itr->second;
return *itr;
}
PyErr_SetString(PyExc_IndexError, "Index is out of range");
throw boost::python::error_already_set();