```\nif (name(stake.left\_) == key) {\n    current.right\_ = stake.right\_;\n    current.after\_ = stake.after\_;\n} else {\n    current.left\_ = stake.left\_;\n    current.before\_ = stake.before\_;\n}\n```\n