ext/iodine/fiobj_hash.c
/**
 * Replaces the value in a key-value pair, returning the old value (and it's
 * ownership) to the caller.
 *
 * A return value of NULL indicates that no previous object existed (but a new
 * key-value pair was created.
 *
 * Errors are silently ignored.
 */
Replaces the value in a key-value pair, returning the old value (and it's
ownership) to the caller.

A return value of NULL indicates that no previous object existed (but a new
key-value pair was created.

Errors are silently ignored.
Replaces the value in a key - value pair returning the old value ( and it ' s ownership ) to the caller . A return value of NULL indicates that no previous object existed ( but a new key - value pair was created . Errors are silently ignored .
FIOBJ fiobj_hash_replace(FIOBJ hash, FIOBJ key, FIOBJ obj) {
  assert(hash && FIOBJ_TYPE_IS(hash, FIOBJ_T_HASH));
  FIOBJ old = FIOBJ_INVALID;
  fio_hash___insert(&obj2hash(hash)->hash, fiobj_obj2hash(key), key, obj, &old);
  fiobj_free(obj); 
  return old;
}
FIOBJ fiobj_hash_replace ( FIOBJ hash , FIOBJ key , FIOBJ obj ) { assert ( hash && FIOBJ_TYPE_IS ( hash , FIOBJ_T_HASH ) ) ; FIOBJ old = FIOBJ_INVALID ; fio_hash___insert ( & obj2hash ( hash ) -> hash , fiobj_obj2hash ( key ) , key , obj , & old ) ; fiobj_free ( obj ) ; return old ; }
Replaces the value in a key-value pair, returning the old value (and it's
 ownership) to the caller.
Replaces the value in a key - value pair returning the old value ( and it ' s ownership ) to the caller .
/* take ownership - free the user's reference. */