bool conf_get_double(const Properties& conf, const std::string& name, double& value, bool ignore_nonexist) { Properties::const_iterator found = conf.find(name); if (found == conf.end()) { return ignore_nonexist; } return string_todouble(found->second, value); }
int ArdbServer::IncrbyFloat(ArdbConnContext& ctx, RedisCommandFrame& cmd) { double increment, val; if (!string_todouble(cmd.GetArguments()[1], increment)) { fill_error_reply(ctx.reply, "value is not a float or out of range"); return 0; } int ret = m_db->IncrbyFloat(ctx.currentDB, cmd.GetArguments()[0], increment, val); if (ret == 0) { fill_double_reply(ctx.reply, val); } else { fill_error_reply(ctx.reply, "value is not a float or out of range"); } return 0; }