You could just check if (sLines.empty()) and get rid of sCachedLines, AFAICT