(svn r19019) -Codechange: use HasExactlyOneBit() and HasAtMostOneBit() instead of CountBits() where possible

This commit is contained in:
smatz
2010-02-05 17:05:58 +00:00
parent 1d6bfd2a6c
commit 6c1ab1a2fa
8 changed files with 35 additions and 11 deletions

View File

@@ -31,7 +31,7 @@
/* static */ bool AIWaypoint::HasWaypointType(StationID waypoint_id, WaypointType waypoint_type)
{
if (!IsValidWaypoint(waypoint_id)) return false;
if (CountBits(waypoint_type) != 1) return false;
if (!HasExactlyOneBit(waypoint_type)) return false;
return (::Waypoint::Get(waypoint_id)->facilities & waypoint_type) != 0;
}