mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
List capacity and SubProcess field name change (#1038)
* std::collections::list: adjust increased capacity * std::os::process: rename conflicting field in SubProcess * c3c: adjust spacing for --list-builtins and --list-keywords
This commit is contained in:
@@ -352,11 +352,11 @@ fn void List.set(&self, usz index, Type value) @operator([]=)
|
||||
fn void List.ensure_capacity(&self, usz added = 1) @inline @private
|
||||
{
|
||||
usz new_size = self.size + added;
|
||||
if (self.capacity > new_size) return;
|
||||
if (self.capacity >= new_size) return;
|
||||
|
||||
assert(new_size < usz.max / 2U);
|
||||
usz new_capacity = self.capacity ? 2U * self.capacity : 16U;
|
||||
while (new_size >= new_capacity) new_capacity *= 2U;
|
||||
while (new_capacity < new_size) new_capacity *= 2U;
|
||||
self.reserve(new_capacity);
|
||||
}
|
||||
|
||||
|
||||
@@ -455,7 +455,7 @@ fn usz! SubProcess.read_stderr(&self, char* buffer, usz size)
|
||||
$endif
|
||||
}
|
||||
|
||||
fn bool! SubProcess.is_alive(&self)
|
||||
fn bool! SubProcess.is_running(&self)
|
||||
{
|
||||
if (!self.is_alive) return false;
|
||||
$if env::WIN32:
|
||||
|
||||
Reference in New Issue
Block a user