Some more fixes and some more errors
This commit is contained in:
@@ -33,7 +33,10 @@ pub const Node = struct {
|
||||
///
|
||||
/// Returns error if the road is not within the node
|
||||
pub fn unreferenceRoad(self: *Node, road: *const Road) !void {
|
||||
if (self.roadInList(road)) |i| _ = self.roads.swapRemove(i);
|
||||
if (self.roadInList(road)) |i| {
|
||||
_ = self.roads.swapRemove(i);
|
||||
return;
|
||||
}
|
||||
|
||||
return error.InvalidNode;
|
||||
}
|
||||
@@ -43,7 +46,10 @@ pub const Node = struct {
|
||||
std.debug.print("Road id = {d}\n", .{road.id});
|
||||
std.debug.print("Road to check id = {d}\n", .{road_to_check.id});
|
||||
// TODO fix why doesn't 0 == 0 return i
|
||||
std.debug.print("{}\n", .{road.id == road_to_check.id});
|
||||
const res = road.id == road_to_check.id;
|
||||
if (road.id == road_to_check.id) return i;
|
||||
if (res) return i;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user