AP_Avoidance: stop copying adsb vehicle onto stack in src_id_for_adsb_vehicle

This commit is contained in:
Peter Barker 2019-07-09 16:16:43 +10:00 committed by Peter Barker
parent 0952ca0abc
commit c6126ec720
2 changed files with 2 additions and 2 deletions

View File

@ -252,7 +252,7 @@ void AP_Avoidance::add_obstacle(const uint32_t obstacle_timestamp_ms,
return add_obstacle(obstacle_timestamp_ms, src, src_id, loc, vel);
}
uint32_t AP_Avoidance::src_id_for_adsb_vehicle(AP_ADSB::adsb_vehicle_t vehicle) const
uint32_t AP_Avoidance::src_id_for_adsb_vehicle(const AP_ADSB::adsb_vehicle_t &vehicle) const
{
// TODO: need to include squawk code and callsign
return vehicle.info.ICAO_address;

View File

@ -156,7 +156,7 @@ private:
void deinit();
// get unique id for adsb
uint32_t src_id_for_adsb_vehicle(AP_ADSB::adsb_vehicle_t vehicle) const;
uint32_t src_id_for_adsb_vehicle(const AP_ADSB::adsb_vehicle_t &vehicle) const;
void check_for_threats();
void update_threat_level(const Location &my_loc,