Float to int is slow on ppc. It requires a store, a big stall, and then a load. It's even worse on a G5 if the compiler is dumb (and let's face it, I'm using gcc here...). Just use lroundf when we want an int. It will certainly be no slower.
This commit is contained in:
@@ -112,7 +112,7 @@ int Trail::GetMeter() const
|
||||
|
||||
float fMeter = GetTotalMeter() / (float)m_vEntries.size();
|
||||
|
||||
return (int)roundf( fMeter );
|
||||
return lroundf( fMeter );
|
||||
}
|
||||
|
||||
int Trail::GetTotalMeter() const
|
||||
|
||||
Reference in New Issue
Block a user