Skip to content

Commit 85e9966

Browse files
committed
Return early for switch
1 parent 4004158 commit 85e9966

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

AT3/AT3Tags.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,19 +211,24 @@ void AT3Tags::OnGetTagItem(CFlightPlan FlightPlan, CRadarTarget RadarTarget, int
211211
switch (ItemCode) {
212212
case TAG_ITEM_AT3_ALTITUDE:
213213
tagOutput = GetFormattedAltitude(RadarTarget);
214-
goto endSwitch;
214+
break;
215215
case TAG_ITEM_AT3_TRACK:
216216
tagOutput = GetFormattedTrack(RadarTarget);
217-
goto endSwitch;
217+
break;
218218
case TAG_ITEM_AT3_SPEED:
219219
tagOutput = GetFormattedGroundspeed(RadarTarget);
220-
goto endSwitch;
220+
break;
221221
case TAG_ITEM_AT3_VS_INDICATOR:
222222
tagOutput = GetVSIndicator(RadarTarget);
223-
goto endSwitch;
223+
break;
224224
case TAG_ITEM_AT3_ADSB_CALLSIGN:
225225
tagOutput = GetADSBCallsign(RadarTarget);
226-
goto endSwitch;
226+
break;
227+
}
228+
229+
if (tagOutput.length() != 0) {
230+
strcpy_s(sItemString, 16, tagOutput.substr(0, 15).c_str());
231+
return;
227232
}
228233

229234
if (FlightPlan.IsValid()) {

0 commit comments

Comments
 (0)