Skip to content

Duplicate objects on the same line #6

@wu-vincent

Description

@wu-vincent

Currently, we check if an object is already present on the line using the __eq__ operator of a dataclass. However, in many cases, the objects are partial and should be merged, which in turn fails the __eq__ check and causes duplication. In such cases, keeping only one copy is also not desirable.

For example, in ZipUtils.h

class ZipSettings {
    ZipSettings();
    ZipSettings(Core::ZipUtils::ZipCompressionLevel);
    ~ZipSettings();
    Core::ZipUtils::ZipFileRestrictions mRestrictions;
    bool mZipDirectoryContents;
    bool mSkipInaccessibleFiles;
    int mCompressionLevel;
    Bedrock::NonOwnerPointer<IFileAccess> mFileAccess;
    std::string mPassword;
    int mZip64;
}; 
class ZipSettings {
    ZipSettings();
    ZipSettings(Core::ZipUtils::ZipCompressionLevel compression);
    ~ZipSettings();
    Core::ZipUtils::ZipFileRestrictions mRestrictions;
    bool mZipDirectoryContents;
    bool mSkipInaccessibleFiles;
    int mCompressionLevel;
    Bedrock::NonOwnerPointer<IFileAccess> mFileAccess;
    std::string mPassword;
    int mZip64;
};

should be merged, and the one with more info (i.e., the one whose constructor has parameter names) should be kept.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions