authorgravatar for moconnor@tutanota.comMatthew O'Connor <moconnor@tutanota.com> 2018-11-16 08:23:41-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-11-16 13:03:13-05:00
logfbd6a66ae7116090d74e6366e9bc3b61706ec9af
treeb376fb01717d7e36e3dcc1e8fb957d366ca6a53e
parente198417687c43081f31668ecf747db54629d8560

camelCase std.rb.set_child to std.rb.setChild


1 files changed, 5 insertions(+), 5 deletions(-)

std/rb.zig+5-5
...@@ -104,7 +104,7 @@ pub const Node = struct {...@@ -104,7 +104,7 @@ pub const Node = struct {
104 return @intToEnum(Color, @intCast(u1, node.parent_and_color & 1));104 return @intToEnum(Color, @intCast(u1, node.parent_and_color & 1));
105 }105 }
106106
107 fn set_child(node: *Node, child: ?*Node, is_left: bool) void {107 fn setChild(node: *Node, child: ?*Node, is_left: bool) void {
108 if (is_left) {108 if (is_left) {
109 node.left = child;109 node.left = child;
110 } else {110 } else {
...@@ -172,7 +172,7 @@ pub const Tree = struct {...@@ -172,7 +172,7 @@ pub const Tree = struct {
172 node.setParent(maybe_parent);172 node.setParent(maybe_parent);
173173
174 if (maybe_parent) |parent| {174 if (maybe_parent) |parent| {
175 parent.set_child(node, is_left);175 parent.setChild(node, is_left);
176 } else {176 } else {
177 tree.root = node;177 tree.root = node;
178 }178 }
...@@ -250,7 +250,7 @@ pub const Tree = struct {...@@ -250,7 +250,7 @@ pub const Tree = struct {
250 // This clause is to avoid optionals250 // This clause is to avoid optionals
251 if (node.left == null and node.right == null) {251 if (node.left == null and node.right == null) {
252 if (maybe_parent) |parent| {252 if (maybe_parent) |parent| {
253 parent.set_child(null, parent.left == node);253 parent.setChild(null, parent.left == node);
254 } else254 } else
255 tree.root = null;255 tree.root = null;
256 color = node.getColor();256 color = node.getColor();
...@@ -264,7 +264,7 @@ pub const Tree = struct {...@@ -264,7 +264,7 @@ pub const Tree = struct {
264 next = node.right.?.getFirst(); // Just checked for null above264 next = node.right.?.getFirst(); // Just checked for null above
265265
266 if (maybe_parent) |parent| {266 if (maybe_parent) |parent| {
267 parent.set_child(next, parent.left == node);267 parent.setChild(next, parent.left == node);
268 } else268 } else
269 tree.root = next;269 tree.root = next;
270270
...@@ -387,7 +387,7 @@ pub const Tree = struct {...@@ -387,7 +387,7 @@ pub const Tree = struct {
387 if (tree.compareFn(old, new) != mem.Compare.Equal) return ReplaceError.NotEqual;387 if (tree.compareFn(old, new) != mem.Compare.Equal) return ReplaceError.NotEqual;
388388
389 if (old.getParent()) |parent| {389 if (old.getParent()) |parent| {
390 parent.set_child(new, parent.left == old);390 parent.setChild(new, parent.left == old);
391 } else391 } else
392 tree.root = new;392 tree.root = new;
393393