Welcome to little lamb

Code » limb » master » tree

[master] / src / liblimb / hmap.h / hmap_get.c

/* This file is part of limb                           https://lila.oss/limb
 * Copyright (C) 2023 Olivier Brunel                          jjk@jjacky.com */
/* SPDX-License-Identifier: GPL-2.0-only */
#include "hmap.h"

void *
hmap_get(u32 key, hmap *hmap)
{
    struct item *it;

    it = lookup(key, hmap);
    if (it->key)
        return it->data;
    return NULL;
}