Skip to content

Commit

Permalink
Add byteSize() to List (#1119)
Browse files Browse the repository at this point in the history
Add byte_size() to List.
  • Loading branch information
tonis2 authored Feb 9, 2024
1 parent fc595f9 commit 0d2ba65
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/std/collections/list.c3
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,11 @@ fn bool List.is_empty(&self) @inline
return !self.size;
}

fn usz List.byte_size(&self) @inline
{
return Type.sizeof * self.size;
}

fn usz List.len(&self) @operator(len) @inline
{
return self.size;
Expand Down

0 comments on commit 0d2ba65

Please sign in to comment.