mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 04:02:37 +03:00
Organize files a bit and removed non source pbo's
This commit is contained in:
28
SQF/dayz_code/compile/fn_inString.sqf
Normal file
28
SQF/dayz_code/compile/fn_inString.sqf
Normal file
@@ -0,0 +1,28 @@
|
||||
//Kilzone_Kid's megafast inString function
|
||||
//caseinsensitive
|
||||
//params [needle,haystack]
|
||||
private["_needle","_haystack","_found","_haystackArr","_haystackLen","_needleLen","_hayArr"];
|
||||
scopeName "main";
|
||||
_needle = _this select 0;
|
||||
_haystack = _this select 1;
|
||||
_haystackArr = toArray _haystack;
|
||||
_haystackLen = count _haystackArr;
|
||||
_needleLen = count (toArray _needle);
|
||||
_found = false;
|
||||
if (_needleLen <= _haystackLen) then {
|
||||
_hayArr = [];
|
||||
for "_i" from 0 to (_needleLen - 1) do {
|
||||
_hayArr set [count _hayArr, _haystackArr select _i];
|
||||
};
|
||||
for "_i" from _needleLen to _haystackLen do {
|
||||
if (toString _hayArr != _needle) then {
|
||||
_hayArr set [_needleLen, _haystackArr select _i];
|
||||
_hayArr set [0, "x"];
|
||||
_hayArr = _hayArr - ["x"];
|
||||
} else {
|
||||
_found = true;
|
||||
breakTo "main";
|
||||
};
|
||||
};
|
||||
};
|
||||
_found
|
||||
Reference in New Issue
Block a user