I'm having an argument with my boss about whether or not it's better to have a separate function for a single line of code.The code reads something like:while (count <= poscount){    key = etc.substr(pos2prev+1, pos-pos2prev-1);    std::string::iterator end_pos = std::remove(key.begin(), key.end(), ' ');    key.erase(end_pos, key.end());    val = etc.substr(pos+1, pos2-pos-1);    //process key and val    DEBUG({\n\t%s:%s\n}\n, key.c_str(), val.c_str());    json_object_object_add(paramList, key.c_str(), json_object_new_string(val.c_str()));     count++;    pos2prev = pos2;    pos = etc.find(=, pos+1);    pos2 = (count == poscount) ? etc.find(\0,pos2+1) : etc.find(&, pos2+1);}Is it better coding style to include the linejson_object_object_add(paramList, key.c_str(), json_object_new_string(val.c_str()));in a separate function name such as processKeyVal(), or leave it as-is?
Separate method for a single line code? Or embed in the caller function?
c++