Skip to content

Commit 41f0831

Browse files
committed
Update Slice comments
1 parent 77b3773 commit 41f0831

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/AudioBasic/Collections/Slice.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Slice {
2323
/// Returns the data
2424
T* data() { return start; }
2525

26-
/// Returns the (result) data size in bytes
26+
/// Returns the (result) data size is number of entries
2727
size_t size() { return len; }
2828

2929
/// Returns the number of slices of the indicated size
@@ -32,7 +32,8 @@ class Slice {
3232
return len % sliceSize == 0 ? result : result+1;
3333
}
3434

35-
operator bool() { return len > 0; }
35+
/// Returns true if we contain any valid data
36+
operator bool() { return len > 0 && start!?nullptr; }
3637

3738
/// Returns the slice at the indicated index for the indicated slize size;
3839
Slice slice(int sliceSize, int idx) {

0 commit comments

Comments
 (0)