Skip to content

Avoid strlen(s) == 0 #705

Open
Open
@xezon

Description

@xezon

Replace tests such as if (strlen(filename) <= 0) with if (filename && *filename). There is no need to count the length of a string when checking for empty.

Another case of wasteful strlen is inside loop conditions:

for (size_t i=0; i<strlen(mapExtension); ++i)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Do LaterWork on this laterInvestigateMinorSeverity: Minor < Major < Critical < BlockerRefactorImproves the structure of the code, with negligible changes in function.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions