The outlook for Yahoo Inc. — or at least its legal department — seems a bit brighter these days. Since ex-Googler Marissa Mayer took over as CEO last July, the company’s shares have steadily risen nearly 56 percent, to more than $24, the highest price since June 2008.

The rising tide seems to be permeating the legal department. Earlier this week, it welcomed back lobbyist William Ashworth, who returned to the Sunnyvale-based search company’s Washington, D.C., office after an eight-month sojourn at Google Inc. Before his detour, he’d been with Yahoo for seven years as senior director of state government affairs, spearheading the company’s state lobbying efforts. He confirmed the move but declined to comment further. A Yahoo spokeswoman said the company was thrilled to have him back.