-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring/IsValid #1197
Refactoring/IsValid #1197
Conversation
…hough its currently not used.
@@ -150,7 +145,8 @@ public void | |||
Log._Debug("Extended building data:"); | |||
|
|||
for (var i = 0; i < ExtBuildings.Length; ++i) { | |||
if (!IsValid((ushort)i)) { | |||
ref Building building = ref ExtBuildings[i].buildingId.ToBuilding(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ups ... gonna change that
Did you compare generated .NET bytecode? |
nope, did not compare bytecode. but I can do. |
I wish we could set the heavy in-lining attribute ( I don't think our version of mono allows that) |
/// </summary> | ||
/// <param name="netLane">netLane</param> | ||
/// <returns>True if the netLane and its netSegment is valid, otherwise false.</returns> | ||
public static bool IsValidWithSegment(this ref NetLane netLane) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some mods like MOM add a buggy lane without segment. This might confuse TMPE. but I am not sure if that extra lane can even have traffic so probably not relevant to TMPE. in any case you haven't changed the logic of the code so I don't expect regression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope I didnt change any logic. but better double check during review in case I mistyped or something. :)
I'll check aggresive inlining. wanted to do that anyway. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I didn't find any typos 👍
see individual commit, but don't get dizzy ;D
IsValid is static now, hope you like it :P