The big-box giant said Thursday that comparable sales at its U.S. business rose 3.4% in the first quarter from a year earlier, its strongest performance on that metric in the period in nine years. The gain reflected both an increase in traffic as well as shoppers spending more per transaction. Online sales rose 37 percent from a year ago.

Fitting a recent pattern, a significant contributor to the online growth was its click-and-collect grocery service. I’ve noted before that this is a sweet spot for Walmart: The service is currently in 2,450 U.S. stores – coverage that Amazon will be hard-pressed to match, given its far smaller lineup of brick-and-mortar stores. And it allows Walmart to make an early land grab in the Wild West that is digital grocery shopping.

Walmart is aggressively pursuing other potential revenue streams that will allow it to capitalize on its status as a both a physical store-based chain and an online retailer. In particular, it is building a digital-advertising business that uses data from both store purchases and visits to its website to help brands target a certain audience.

And even when Walmart is fighting on turf that is more traditionally Amazon’s, we see hints that it is doing a better job of keeping pace. When Amazon announced recently it was working to go to one-day shipping as the standard for its Prime program, Walmart essentially revealed in a tweet the following day that it was soon to launch something similar.

This week, Walmart made it official. But clearly, a logistical shift of that scale and scope was in the works at least months before Amazon made its move known.(1) Also, Walmart says its next-day shipping on a selection of up to 220,000 items won’t add to its costs. That looks good next to Amazon’s announcement that its shift to one-day Prime shipping would cost $800 million in the current quarter – and is likely a relief to investors who have been understandably skittish about how much Walmart’s operating margins have shrunk in recent years.

Despite all this good news, I stand by my warning earlier this week that all retailers, Walmart included, should be seriously worried about the potential consequences of the escalating trade war. Indeed, the company’s CFO Brett Biggs told Bloomberg News’s Matt Boyle on Thursday morning, “We will do everything we can to keep prices low, but increased tariffs lead to increased prices.”

Walmart, at least, has some advantages compared to other chains in navigating tariff hikes. Its sheer size gives it more power than most in negotiating with suppliers. And if U.S. shoppers eventually start to feel the squeeze of higher costs for all sorts of consumer goods, Walmart’s reputation as a place with rock-bottom prices should serve it well.

There are still plenty of uncertainties in Walmart’s business, particularly outside the U.S. market. After U.K. regulators blocked an attempt to merge its Asda grocery chain with rival J Sainsbury PLC, it must figure out a path forward for that unit. Executives confirmed Thursday they are considering an IPO for Asda, but it’s unclear what kind of interest that will drum up from investors – especially since Asda didn’t deliver strong comparable sales in the quarter. Furthermore, Walmart’s massive investment in Flipkart, an Indian e-commerce player, creates a near-term drag on profit and is a bet on a market that has huge potential, but loads of challenges, including regulatory ones.

But as long as things look so solid in its home market, I suspect investors will have patience for the rest.

(1) Amazon fired off its own snarky tweet after Walmart's next-day shipping announcement, a move that felt noteworthy from a company that professes to be focused on its customers, not its competitors.

To contact the author of this story: Sarah Halzack at shalzack@bloomberg.net

To contact the editor responsible for this story: Beth Williams at bewilliams@bloomberg.net

This column does not necessarily reflect the opinion of the editorial board or Bloomberg LP and its owners.

Sarah Halzack is a Bloomberg Opinion columnist covering the consumer and retail industries. She was previously a national retail reporter for the Washington Post.