]> git.ipfire.org Git - thirdparty/git.git/commit - oidset.h
oidset: make oidset_size() an inline function
authorRené Scharfe <l.s.r@web.de>
Sat, 11 Sep 2021 20:36:40 +0000 (22:36 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sun, 12 Sep 2021 23:14:32 +0000 (16:14 -0700)
commit325006f2dbeb482f422b2c0e62b485a41cb1c64b
tree4bea8e20d6c343fff9d54ae27776942b7e94ff6d
parent8b7c11b8668b4e774f81a9f0b4c30144b818f1d1
oidset: make oidset_size() an inline function

oidset_size() just reads a single word from memory and returns it.
Avoid the function call overhead for this trivial operation by turning
it into an inline function.

While we're at it, declare its parameter const to allow it to be used
on read-only oidsets.

Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
oidset.c
oidset.h