Skip to content
This repository was archived by the owner on Dec 12, 2018. It is now read-only.
This repository was archived by the owner on Dec 12, 2018. It is now read-only.

Refactor sort using operator overloading #135

@tmancey

Description

@tmancey

Recommended to refactor the following code (not just limited to PublisherInfo):

bool PublisherInfo::operator<(const PublisherInfo& rhs) const {
    return score > rhs.score;

to

bool PublisherInfoSort(PublisherInfo const& lhs, PublisherInfo const& rhs) {
    return lhs.score > rhs.score;
}

std::sort(publisher_info.begin(), publisher_info.end(), &PublisherInfoSort);

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