TORONTO — In a salary-cap world, not every transaction is quite what it seems.

Case in point: The news late Tuesday afternoon that the Toronto Maple Leafs had recalled winger Casey Bailey from the American Hockey League while sending centre Byron Froese back down.

That raised some alarm bells, especially since Leafs coach Mike Babcock has repeatedly praised Froese’s performance in recent days and had already said he’ll “be in the lineup” for Friday’s game at Madison Square Garden.

Those plans haven’t changed.

What the Froese/Bailey flip-flop was really about instead is maximizing the benefit the Leafs received by placing Nathan Horton on long-term injured reserve. That roster move also happened Tuesday, according to a source.

The Leafs have had the option to do that with Horton since the regular season began because the 30-year-old winger continues to suffer from a debilitating back issue that is expected to end his NHL career. (Horton flew to Toronto to undergo a medical with Leafs doctors at the beginning of training camp).

However, the key aspect of the LTIR provision is that it only allows a team to exceed the salary cap ceiling by the amount it needs while a player is out. It was therefore more beneficial for the Leafs to be as close to the $71.4-million cap as possible when it was invoked, something the Froese/Bailey transaction accomplished.

With Bailey due to earn $337,500 more than Froese in the NHL this year, the move put Toronto within $88,333 of the cap ceiling, according to capfriendly.com. Horton’s $5.3-million annual deal was then placed on LTIR, which permits the Leafs to exceed the cap by more than $5.2-million for the remainder of the season.

That leaves the front office with plenty of flexibility in the months ahead.

Meanwhile, long before the puck is dropped in New York on Friday night, Froese should be back with the Leafs while Bailey rejoins the Marlies. Neither player currently requires waivers, so that expected transaction will be much more clear-cut than the one they were originally part of.