Skip to content

Commit

Permalink
Markers - Optimise map marker timestamp filtering (#10414)
Browse files Browse the repository at this point in the history
Optimise map marker timestamp filtering
  • Loading branch information
johnb432 authored Oct 15, 2024
1 parent 021fe22 commit 2523d7f
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions addons/markers/functions/fnc_removeTimestamp.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,14 @@

params ["_original"];

// @todo, 2.02 reverse command will support STRING types
private _string = toArray _original;
reverse _string;
_string = toString _string;
private _string = reverse _original;

if (_string select [0, 1] != "]") exitWith {_original};

private _timestampLength = (_string find "[") + 1;
_string = _string select [0, _timestampLength];

// @todo
_string = toArray _string;
reverse _string;
_string = toString _string;
_string = reverse _string;

if (_string select [0, 1] != "[") exitWith {_original};

Expand Down Expand Up @@ -64,7 +58,7 @@ while {_keepCheckingDigits} do {
};

if (_validTimestamp) then {
[_original select [0, count _original - _timestampLength], " "] call CBA_fnc_rightTrim // return
(_original select [0, count _original - _timestampLength]) trim [" ", 2] // return
} else {
_original // return
}

0 comments on commit 2523d7f

Please sign in to comment.