aboutsummaryrefslogtreecommitdiff
path: root/src/yellow/red.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-07-30 16:14:14 +0100
committerAleksey Kladov <[email protected]>2018-07-30 16:14:14 +0100
commit6fc66c4ee667da871ea1f0c8b48b5e9b7373a187 (patch)
tree11bf3d276afe15e328f6d600ea84010c2c693b52 /src/yellow/red.rs
parentbeaddb478097223c87e507bf9367d85d86df5d06 (diff)
Use boxed sliced for red nodes
Diffstat (limited to 'src/yellow/red.rs')
-rw-r--r--src/yellow/red.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/yellow/red.rs b/src/yellow/red.rs
index 8907100e4..bffb72510 100644
--- a/src/yellow/red.rs
+++ b/src/yellow/red.rs
@@ -5,7 +5,7 @@ use {yellow::GreenNode, TextUnit};
5pub(crate) struct RedNode { 5pub(crate) struct RedNode {
6 green: GreenNode, 6 green: GreenNode,
7 parent: Option<ParentData>, 7 parent: Option<ParentData>,
8 children: RwLock<Vec<Option<RedNode>>>, 8 children: RwLock<Box<[Option<RedNode>]>>,
9} 9}
10 10
11#[derive(Debug)] 11#[derive(Debug)]
@@ -36,7 +36,9 @@ impl RedNode {
36 36
37 fn new(green: GreenNode, parent: Option<ParentData>) -> RedNode { 37 fn new(green: GreenNode, parent: Option<ParentData>) -> RedNode {
38 let n_children = green.children().len(); 38 let n_children = green.children().len();
39 let children = (0..n_children).map(|_| None).collect(); 39 let children = (0..n_children).map(|_| None)
40 .collect::<Vec<_>>()
41 .into_boxed_slice();
40 RedNode { 42 RedNode {
41 green, 43 green,
42 parent, 44 parent,