From 2c55bbcabef3cb2aee624d2f666c4771c32f7c28 Mon Sep 17 00:00:00 2001 From: martinvuyk Date: Wed, 18 Dec 2024 21:16:02 -0300 Subject: [PATCH] Rename List.bytecount() to byte_length() Signed-off-by: martinvuyk --- stdlib/src/collections/list.mojo | 6 +++--- stdlib/test/collections/test_list.mojo | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/stdlib/src/collections/list.mojo b/stdlib/src/collections/list.mojo index f0bc3d0c6a..7e38d7e00b 100644 --- a/stdlib/src/collections/list.mojo +++ b/stdlib/src/collections/list.mojo @@ -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]() diff --git a/stdlib/test/collections/test_list.mojo b/stdlib/test/collections/test_list.mojo index 56dab6510b..826a72a814 100644 --- a/stdlib/test/collections/test_list.mojo +++ b/stdlib/test/collections/test_list.mojo @@ -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])