Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some issues reported by LGTM #2000

Merged
merged 6 commits into from
Oct 18, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
LineHypothesis: Add copy assignment operator
This fixes a warning from LGTM:

    No matching copy assignment operator in class LineHypothesis.
    It is good practice to match a copy constructor
    with a copy assignment operator.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Oct 18, 2018
commit 0bbd5c5d1c45f8ccbdc98a14b2181952cf037322
7 changes: 7 additions & 0 deletions src/ccmain/paragraphs_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ struct LineHypothesis {
LineHypothesis(const LineHypothesis &other)
: ty(other.ty), model(other.model) {}

// Copy assignment operator.
LineHypothesis& operator=(const LineHypothesis& other) {
ty = other.ty;
model = other.model;
return *this;
}

bool operator==(const LineHypothesis &other) const {
return ty == other.ty && model == other.model;
}
Expand Down