Patch is our child #814

Merged
merged 2 commits into from Apr 18, 2015

Projects

None yet

3 participants

@SimonSchick
Contributor

It goes up the gui tree rather than down.

@robotboy655
Collaborator

Why? It seems to that it is supposed to down the tree?

@willox
Collaborator
willox commented Sep 27, 2014

The current function checks all children of self (and those children's children) for equality with the argument.
The new function (supposedly) will check all parents of the argument (and those parent's parents) for equality with self.

Theoretically this could improve the runtime of this function a shit load, as it won't cause code to travel down any parent-child routes that aren't neccesary unlike the current code which travels down every parent-child route possible.

@SimonSchick
Contributor

Turns out there is a function doing pretty much the same but with the arguments swapped called pnl:HasParent(parent).

I updated the pr to use this function but I recommend to remove this function instead and replace it with HasParent.

@robotboy655 robotboy655 added the pending label Sep 28, 2014
@robotboy655
Collaborator

Add if ( !IsValid( child ) ) then return false end to the first line.

@robotboy655 robotboy655 merged commit b2af437 into garrynewman:master Apr 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment