Skip to content

Commit

Permalink
Rename List.bytecount() to byte_length()
Browse files Browse the repository at this point in the history
Signed-off-by: martinvuyk <[email protected]>
  • Loading branch information
martinvuyk committed Dec 19, 2024
1 parent f3432eb commit 2c55bbc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions stdlib/src/collections/list.mojo
Original file line number Diff line number Diff line change
Expand Up @@ -469,11 +469,11 @@ struct List[T: CollectionElement, hint_trivial_type: Bool = False](
# Methods
# ===-------------------------------------------------------------------===#

fn bytecount(self) -> Int:
"""Gets the bytecount of the List.
fn byte_length(self) -> Int:
"""Gets the byte length of the List.
Returns:
The bytecount of the List.
The byte length of the List.
"""
return len(self) * sizeof[T]()

Expand Down
2 changes: 1 addition & 1 deletion stdlib/test/collections/test_list.mojo
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_list():
list.append(i)

assert_equal(5, len(list))
assert_equal(5 * sizeof[Int](), list.bytecount())
assert_equal(5 * sizeof[Int](), list.byte_length())
assert_equal(0, list[0])
assert_equal(1, list[1])
assert_equal(2, list[2])
Expand Down

0 comments on commit 2c55bbc

Please sign in to comment.