WASHINGTON (AP) _ The Senate on Thursday approved without comment the nomination of liberal Seattle attorney William L. Dwyer, the subject of a former senator's controversial vote trade, to be a U.S. district judge for the Western District of Washington.

The Senate sent the nomination to President Reagan on a voice vote, along with those of four judicial candidates.

The entire process took less than two minutes, even though Dwyer had been the subject of two hearings before the Senate Judiciary Committee, including one session that lasted six hours.

In a report to the Senate, Sen. Patrick Leahy, D-Vt., who conducted the hearings, said, ''In my view, William Dwyer is one of the most highly qualified district court nominees to come before the Senate in this or any other year in recent history.''

After the Senate confirmation, Sen. Dan Evans, R-Wash., said Dwyer, 58, will bring much moral courage and enlightened wisdom to the bench that all who sit in judgment before him - no matter how unpopular - will receive just treatment.''

Dwyer's nomination has been the subject of controversy since he was named by President Reagan in March 1986 on the recommendation of Dwyer and former Sen. Slade Gorton, R-Wash. Dwyer had worked with Gorton during Gorton's 12 years as Washington attorney general.

The nomination initially was held up for three months. In an effort to get the White House to act on Dwyer's appointment, Gorton agreed to vote for the Reagan administration's appointment of conservative lawyer Daniel Manion to the 7th U.S. Circuit Court of Appeals.

Gorton's vote trade, which proved decisive in confirming Manion, haunted him in last year's Senate campaign, when he was defeated by Democrat Brock Adams.

The Senate, however, failed to cast a confirmation vote before the end of the 99th Congress, and the Dwyer nomination died.

Evans and Adams recommended Dwyer again last March, and he was renominated by Reagan in August in an action attacked by conservative groups.

They complained that Dwyer had represented the Seattle Library Board when critics sought to have a sex education picture book for children, ''Show Me 3/8'' banned from library shelves.

At the Senate hearing, Dwyer testified that the '''Show Me 3/8'' is not a book I would have in my house,'' adding, ''I feel strongly against its use.''

However, he defended his advice to the library board as a correct legal interpretation, namely that the book did not violate state or federal pornography laws.

Leahy told the Senate in his report that: ''Mr. Dwyer's behavior at the hearings told me that he is not only a nominee with outstanding credentials; he is also a man with the decisiveness to 'call them as he sees them,' and with the courage to stand by his convictions.

''He is, in short, the kind of nominee who will be a credit to the federal bench,'' said Leahy.

The other court nominees approved by the Senate were David J. Larimer for the Western District of New York, James A. Parker for the District of New Mexico, William L. Standish for the Western District of Pennsylvania and Ernest Torre for the District of Rhode Island.