def __setupConnections( self, reuseUntil=None ) :

		if self.__graphComponent is None :
			self.__connections = []
			return

		# when a parent has changed somewhere in the hierarchy,
		# we only need to make new connections for the components
		# for the new parent and its ancestors - the connections for
		# components below the parent can be reused. this might seem
		# like a rather pointless optimisation, but it's actually
		# critical - we are called from within __parentChanged( someComponent )
		# and if were to reconnect __parentChanged to someComponent
		# here, __parentChanged would be called again immediately,
		# resulting in an infinite loop. our updatedConnections will
		# be a mix of reused connections and newly created ones.

		updatedConnections = []

		n = 0
		g = self.__graphComponent
		reuse = reuseUntil is not None
		while g is not None and n < self.__numComponents :
			if reuse :
				updatedConnections.extend( self.__connections[n*2:n*2+2] )
			else :
				updatedConnections.append( g.nameChangedSignal().connect( Gaffer.WeakMethod( self.__setText ) ) )
				if self.__numComponents - 1 < n :
					updatedConnections.append( g.parentChangedSignal().connect( Gaffer.WeakMethod( self.__parentChanged ) ) )

			if g.isSame( reuseUntil ) :
				reuse = False

			g = g.parent()
			n += 1

		self.__connections = updatedConnections
dataset/ETHPy150Open ImageEngine/gaffer/python/GafferUI/NameLabel.py/NameLabel.__setupConnections/swapped operands of `<`