summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-06-13 07:29:19 -0700
committerKaz Kylheku <kaz@kylheku.com>2019-06-13 07:29:19 -0700
commitf9cd0b3815083f3827cd00b15e1ccf9a8706ad3c (patch)
treed945347f1b3cf8fdfb0174f74354a04b3126a5c6
parent9a275d84effb81f25f409d9bcb95726173018b68 (diff)
downloadtxr-f9cd0b3815083f3827cd00b15e1ccf9a8706ad3c.tar.gz
txr-f9cd0b3815083f3827cd00b15e1ccf9a8706ad3c.tar.bz2
txr-f9cd0b3815083f3827cd00b15e1ccf9a8706ad3c.zip
replace-str, replace-vec: remove call to len.
* lib.c (replace_str, replace_vec): Remove redundant calculation of input sequence length; there is a len variable bound on entry into the function.
-rw-r--r--lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib.c b/lib.c
index 70dba1cc..385101cb 100644
--- a/lib.c
+++ b/lib.c
@@ -3764,7 +3764,7 @@ val replace_str(val str_in, val items, val from, val to)
} else if (from == t) {
from = len;
} else if (!integerp(from)) {
- val len = length_str(str_in), wh, item;
+ val wh, item;
seq_iter_t wh_iter, item_iter;
seq_iter_init(self, &item_iter, items);
seq_iter_init(self, &wh_iter, from);
@@ -7174,7 +7174,7 @@ val replace_vec(val vec_in, val items, val from, val to)
from = len;
} else if (!integerp(from)) {
seq_iter_t wh_iter, item_iter;
- val len = length_vec(vec_in), wh, item;
+ val wh, item;
seq_iter_init(self, &wh_iter, from);
seq_iter_init(self, &item_iter, items);