Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incr/decr marks record as number #22

Merged
merged 1 commit into from
Feb 29, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions python/mcache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ template <typename impl_t>
class client_t {
public:


/** Flags that are used as type mark.
*/
enum {
Expand Down Expand Up @@ -269,8 +268,8 @@ class client_t {
if (!result) return not_found(def);

// extract data
boost::python::object data =
data_from_string(result.data, result.flags);
boost::python::object
data = data_from_string(result.data, result.flags);

// return result
boost::python::dict dict;
Expand Down Expand Up @@ -376,8 +375,9 @@ class client_t {

boost::python::object incrio(const std::string &key,
uint64_t inc,
const opts_t &opts)
opts_t opts)
{
opts.flags |= LONG;
std::pair<uint64_t, bool> pair = client->incr(key, inc, opts);
if (!pair.second) return boost::python::object();
return boost::python::object(pair.first);
Expand All @@ -393,8 +393,9 @@ class client_t {

boost::python::object decrio(const std::string &key,
uint64_t dec,
const opts_t &opts)
opts_t opts)
{
opts.flags |= LONG;
std::pair<uint64_t, bool> pair = client->decr(key, dec, opts);
if (!pair.second) return boost::python::object();
return boost::python::object(pair.first);
Expand Down