mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 03:51:18 +00:00
Update .len for subarray to not require ()
This commit is contained in:
@@ -101,7 +101,7 @@ func void testArrays()
|
||||
{
|
||||
printf("index[%d]: %d\n", i, a);
|
||||
}
|
||||
printf("Length is a runtime value: %d\n", y.len());
|
||||
printf("Length is a runtime value: %d\n", y.len);
|
||||
puts("Getting a slice from the beginning to an offset of the end---");
|
||||
y = x[..^2]; // Same as x[0..^2]
|
||||
foreach (i, a : y)
|
||||
|
||||
@@ -26,9 +26,9 @@ struct TopoList
|
||||
public func void sort(InputPair[] pairs, uint elements)
|
||||
{
|
||||
printf(.x = "fe");
|
||||
InputPair[] result = @array::make(InputPair, pairs.len());
|
||||
InputPair[] result = @array::make(InputPair, pairs.len);
|
||||
TopoList* top = mem::calloc(TopoList.sizeof, elements);
|
||||
for (int i = 0; i < pairs.len(); i++)
|
||||
for (int i = 0; i < pairs.len; i++)
|
||||
{
|
||||
InputPair pair = pairs[i];
|
||||
assert(pair.value >= 0 && pair.value < elements);
|
||||
|
||||
Reference in New Issue
Block a user