summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Weiner <hannes@cmpxchg.org>2009-11-24 01:44:35 +0100
committerJohannes Weiner <hannes@cmpxchg.org>2009-11-24 01:44:35 +0100
commit3a3a214f6e35bdc8d01a89b1e2612b4ca0f9a5b4 (patch)
treef52977d66a676add35cdd570d77b25f6229494ba
parentf19c3cd7bc67938143289c182580826f01071c75 (diff)
number: remove equality predicate callback
Fixnums are encoded in the reference pointers. Since sheep_equal() already compares those directly, there is no need for numbers to provide an additional callback. Remove it. Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
-rw-r--r--sheep/number.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sheep/number.c b/sheep/number.c
index d39d04c..2579500 100644
--- a/sheep/number.c
+++ b/sheep/number.c
@@ -22,11 +22,6 @@ static int test_number(sheep_t sheep)
return !!sheep_fixnum(sheep);
}
-static int equal_number(sheep_t a, sheep_t b)
-{
- return a == b;
-}
-
static void format_number(sheep_t sheep, char **bufp, size_t *posp)
{
sheep_addprintf(bufp, posp, "%ld", sheep_fixnum(sheep));
@@ -36,7 +31,10 @@ const struct sheep_type sheep_number_type = {
.name = "number",
.compile = sheep_compile_constant,
.test = test_number,
- .equal = equal_number,
+ /*
+ * Fixnums are encoded in the reference pointer, equality is
+ * thus checked directly in sheep_equal().
+ */
.format = format_number,
};