Commit 61a65ad6f63c940375873948ae6cef917bfcb01b

Thomas de Grivel 2024-03-06T09:14:44

remove integer_init

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/libc3/ratio.c b/libc3/ratio.c
index 521552b..51b91e1 100644
--- a/libc3/ratio.c
+++ b/libc3/ratio.c
@@ -335,12 +335,6 @@ s_ratio * ratio_sub (const s_ratio *a, const s_ratio *b,
   assert(dest);
   assert(integer_is_positive(&a->denominator));
   assert(integer_is_positive(&b->denominator));
-  if (! integer_init(&tmp.numerator))
-    return NULL;
-  if (! integer_init(&tmp.denominator)) {
-    integer_clean(&tmp.numerator);
-    return NULL;
-  }
   if (! integer_mul(&a->numerator, &b->denominator, &i)) {
     ratio_clean(&tmp);
     return NULL;