Skip to content

Commit

Permalink
lone: use count function when iterating vectors
Browse files Browse the repository at this point in the history
I went to the trouble of adding this function. Might as well use it.
  • Loading branch information
matheusmoreira committed Dec 17, 2023
1 parent 29d50db commit 169856e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion source/lone/lisp/printer.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ static void lone_print_vector(struct lone_lisp *lone, struct lone_value vector,
size_t count, i;

actual = vector.as.heap_value;
count = actual->as.vector.count;
count = lone_vector_count(vector);

if (count == 0) { linux_write(fd, "[]", 2); return; }

Expand Down
2 changes: 1 addition & 1 deletion source/lone/modules/intrinsic/vector.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ LONE_PRIMITIVE(vector_slice)
i = start.as.unsigned_integer;

if (lone_is_nil(arguments)) {
j = actual->as.vector.count;
j = lone_vector_count(vector);
} else {
end = lone_list_first(arguments);
arguments = lone_list_rest(arguments);
Expand Down

0 comments on commit 169856e

Please sign in to comment.