• oranagra's avatar
    dict.c: introduce dictUnlink(). · afcbcc0e
    oranagra authored
    Notes by @antirez:
    
    This patch was picked from a larger commit by Oran and adapted to change
    the API a bit. The basic idea is to avoid double lookups when there is
    to use the value of the deleted entry.
    
    BEFORE:
    
        entry = dictFind( ... ); /* 1st lookup. */
        /* Do somethjing with the entry. */
        dictDelete(...);         /* 2nd lookup. */
    
    AFTER:
    
        entry = dictUnlink( ... ); /* 1st lookup. */
        /* Do somethjing with the entry. */
        dictFreeUnlinkedEntry(entry); /* No lookups!. */
    afcbcc0e
module.c 124 KB