Codechange: Pass ContentInfo by reference.

Many functions take a ContentInfo pointer, but do not check for nullptr.
Pass by reference instead to assure it is present.
This commit is contained in:
2025-04-10 07:37:28 +01:00
committed by Peter Nelson
parent 1cfad1474a
commit 7b31f26611
17 changed files with 94 additions and 94 deletions

View File

@@ -680,13 +680,13 @@ static ScenarioScanner _scanner;
* @param md5sum Whether to look at the md5sum or the id.
* @return The filename of the file, else \c nullptr.
*/
const char *FindScenario(const ContentInfo *ci, bool md5sum)
const char *FindScenario(const ContentInfo &ci, bool md5sum)
{
_scanner.Scan(false);
for (ScenarioIdentifier &id : _scanner) {
if (md5sum ? (id.md5sum == ci->md5sum)
: (id.scenid == ci->unique_id)) {
if (md5sum ? (id.md5sum == ci.md5sum)
: (id.scenid == ci.unique_id)) {
return id.filename.c_str();
}
}
@@ -700,7 +700,7 @@ const char *FindScenario(const ContentInfo *ci, bool md5sum)
* @param md5sum Whether to look at the md5sum or the id.
* @return True iff we've got the scenario.
*/
bool HasScenario(const ContentInfo *ci, bool md5sum)
bool HasScenario(const ContentInfo &ci, bool md5sum)
{
return (FindScenario(ci, md5sum) != nullptr);
}