Skip to content

Mapper::findBy成员函数的优化建议 #2496

@windflowerly

Description

@windflowerly

原drogon::orm::Mapper::findBy函数返回语句是这样写的

    .....
    std::vector<T> ret;
    for (auto const &row : r)
    {
        ret.push_back(T(row));
    }
    return ret;

此处是一个值传递,会引起重复的拷贝动作。可否换成移动语义,减少拷贝

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