Shireen Baratheon was sacrificed to the flames so R’hllor got his due. Whether Melisandre was doing it in her mind for the sake Stannis’ victory against House Bolton instead of Jon Snow’s resurrection (who was still alive at the time) a side point. Actions the main thing. Is R’hllor that bothered by motives?

No. A thousand times no. 

The sacrifice of Shireen Baratheon has absolutely nothing to do with Jon Snow. 

Hell, in the show, Jon hasn’t been attacked yet when that happens!