Skip to content

refactor(ConnectionManager): simplify hasValidTransferFileExtension using getTransferFileType #2529

@bobtista

Description

@bobtista

After #1819 is merged, hasValidTransferFileExtension in ConnectionManager.cpp can be simplified.

Currently it maintains its own hardcoded validExtensions[] array and loops over it manually. PR #1819 adds getTransferFileType() which already does the same extension lookup against the transferFileRules[] table.

hasValidTransferFileExtension should be refactored to call getTransferFileType() and return getTransferFileType(ext) != TransferFileType_Invalid, eliminating the duplicate extension list and the redundant loop.

Noted by xezon in the #1819 review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions