summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--arith.c7
2 files changed, 5 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index de1ce0ca..0b07cdbf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2012-03-21 Kaz Kylheku <kaz@kylheku.com>
+ * arith.c (plus, minus, mul): Removing unnecessary type checks,
+ which are already implied by the switch case.
+
+2012-03-21 Kaz Kylheku <kaz@kylheku.com>
+
* txr.1: Doc stubs for new functions floatp, integerp,
float-str, int-flo and flo-int.
diff --git a/arith.c b/arith.c
index 51fcaa25..1a5981ec 100644
--- a/arith.c
+++ b/arith.c
@@ -305,7 +305,6 @@ tail:
case BGNUM:
{
val n;
- type_check(anum, BGNUM);
n = make_bignum();
if (sizeof (int_ptr_t) <= sizeof (mp_digit)) {
cnum b = c_num(bnum);
@@ -334,8 +333,6 @@ tail:
case TYPE_PAIR(BGNUM, BGNUM):
{
val n;
- type_check(anum, BGNUM);
- type_check(bnum, BGNUM);
n = make_bignum();
mp_add(mp(anum), mp(bnum), mp(n));
return normalize(n);
@@ -456,8 +453,6 @@ tail:
case TYPE_PAIR(BGNUM, BGNUM):
{
val n;
- type_check(anum, BGNUM);
- type_check(bnum, BGNUM);
n = make_bignum();
mp_sub(mp(anum), mp(bnum), mp(n));
return normalize(n);
@@ -618,8 +613,6 @@ tail:
case TYPE_PAIR(BGNUM, BGNUM):
{
val n;
- type_check(anum, BGNUM);
- type_check(bnum, BGNUM);
n = make_bignum();
mp_mul(mp(anum), mp(bnum), mp(n));
return n;