UniFirst (UNF) - Get Report , which supplies and services uniforms and workwear to various industries, will report second-quarter fiscal 2016 earnings results before the opening bell Wednesday.

Headquartered in Wilmington, Mass., UniFirst makes money by supplying and servicing specialty uniform and industrial workwear. Weak oil prices have hurt the industrial sector, and the company -- despite beating Wall Street estimates in seven straight quarters -- has struggled to grow revenue and profits. Its core laundry revenue declined 0.2% in the first quarter, while its gross profit rate decreased 40 basis points.

Still, that hasn't stopped UniFirst stock, which is up 5% year to date. It has outperformed both the S&P 500 (SPX) and the Dow Jones Industrial Average (DJI) . And with oil prices back near $40 per barrel, industrial production should begin to rise. And this not only bodes well for UniFirst's earnings in the next 12 to 18 months, it also makes UniFirst stock a solid buy ahead of Wednesday's results since the company may offer an upbeat outlook.

For the quarter that ended in February, the company is expected to earn $1.26 per share on revenue of $362.62 million, compared to the year-ago quarter, when UniFirst earned $1.37 per share on revenue of $361.46 million. For the full year, ending inAugust, earnings are projected to decline 7.6% year over year to $5.82 per share, while revenue of $1.47 billion would mark a year-over-year increase of 1%.

Weak oil prices have forced many of UniFirst's customers to slash their budgets, making it harder for UniFirst to grow revenue. But UniFirst generates roughly $232 million in operating cash flow, up 15%. The company still maintained its solid balance sheet of $311 million in cash, up 44%, and long-term debt is only $600,000.

What's more, with UniFirst stock currently trading at around $110, the shares are priced at just 17 times forward 2017 earnings per share estimates $6.23, which is in line with the average stock in the S&P 500 index. That suggests that UniFirst is heading back toward long-term growth.

If oil prices can maintain their rally, UniFirst's profit margins should also trend higher. That makes UniFirst stock a bargain at current levels, even after its solid year-to-date performance.

This article is commentary by an independent contributor. At the time of publication, the author held no positions in the stocks mentioned.