Skip to content

Instantly share code, notes, and snippets.

View caryfitzhugh's full-sized avatar

Cary FitzHugh caryfitzhugh

View GitHub Profile
@caryfitzhugh
caryfitzhugh / gist:1287079
Created October 14, 2011 13:21
Pseudo Code For Redis Weighted Sorts
if (fieldlen > 0 ) {
if (o->type != REDIS_HASH || fieldname.len < 1) return NULL;
// Here is my new code inserted
// There is probably a better way to test for the []..
if (fieldname.buf[0] == '[' && fieldname.buf[fieldname.len] == ']') {
// First - do I need to do something with the refCount on the o above?
decrRefCount(o);
// Then I need to somehow create an robj with REDIS_ENCODING_INT