Commit 393b81a3 authored by Mikaël Salson's avatar Mikaël Salson

kmeraffect.cpp: AFFECT_{UNKNOWN,AMBIGUOUS} more efficient comparison

It should be more efficient to compare affects directly rather
than having an implicit conversion followed by a comparison.
However are these functions really called often?
parent fe5608b7
......@@ -53,7 +53,7 @@ bool operator!=(const affect_t &a1, const affect_t &a2) {
}
string toString(const affect_t &a) {
string result;
if((a == AFFECT_UNKNOWN) || (a == AFFECT_AMBIGUOUS))
if((a == AFFECT_UNKNOWN.affect) || (a == AFFECT_AMBIGUOUS.affect))
result = " ";
else
result = (affect_strand(a)==1 ? "+" : "-");
......@@ -67,7 +67,7 @@ string toStringValues(const affect_t &a){
}
string toStringSigns(const affect_t &a){
if((a == AFFECT_UNKNOWN) || (a == AFFECT_AMBIGUOUS))
if((a == AFFECT_UNKNOWN.affect) || (a == AFFECT_AMBIGUOUS.affect))
return " ";
else
return (affect_strand(a)==1 ? "+" : "-");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment