From 087a00b6368a1628d30825f44b88c8f023431201 Mon Sep 17 00:00:00 2001 From: Mikhalkovich Stanislav Date: Mon, 22 Jan 2024 14:49:04 +0300 Subject: [PATCH] =?UTF-8?q?Shuffle=20-=20=D0=BE=D0=BF=D1=82=D0=B8=D0=BC?= =?UTF-8?q?=D0=B0=D0=BB=D1=8C=D0=BD=D0=B5=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Configuration/GlobalAssemblyInfo.cs | 2 +- Configuration/Version.defs | 4 ++-- Localization/DefaultLang.resources | Bin 101686 -> 101893 bytes Release/pabcversion.txt | 2 +- ReleaseGenerators/PascalABCNET_version.nsh | 2 +- TestSuite/CompilationSamples/PABCSystem.pas | 20 ++++++++------------ 6 files changed, 13 insertions(+), 17 deletions(-) diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index 6fc89b8ce..35db7addf 100644 --- a/Configuration/GlobalAssemblyInfo.cs +++ b/Configuration/GlobalAssemblyInfo.cs @@ -15,7 +15,7 @@ internal static class RevisionClass public const string Major = "3"; public const string Minor = "9"; public const string Build = "0"; - public const string Revision = "3418"; + public const string Revision = "3419"; public const string MainVersion = Major + "." + Minor; public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision; diff --git a/Configuration/Version.defs b/Configuration/Version.defs index 963a31e86..1866a0792 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ -%COREVERSION%=0 -%REVISION%=3418 %MINOR%=9 +%REVISION%=3419 +%COREVERSION%=0 %MAJOR%=3 diff --git a/Localization/DefaultLang.resources b/Localization/DefaultLang.resources index 814fc980c385db790b948ed63d3cea77eb2d6cb0..48f76c2a172eadf797700b75c248595c3dde7e59 100644 GIT binary patch delta 219 zcmdlsi>-AI+k^*9ioF{j#roN$re_wHq!u~mr8wv3l@#UY1mu*aXXfdpB$n`UsRjhO zx_L&Z+VXPg>jy!VDkSEmC_oiY4rG+54{~+)3=VM(ig)yLiFfw*3kmY~i4X7zb@%j( z=jHNq^mVm8@aWUK4=(a: array of T); begin - var n := a.Length; - for var i := 0 to n - 1 do - Swap(a[i], a[Random(n)]); + for var i := a.Length - 1 downto 1 do + Swap(a[i], a[Random(i + 1)]); end; procedure Shuffle(l: List); begin - var n := l.Count; - for var i := 0 to n - 1 do + for var i := l.Count - 1 downto 1 do begin - var ind := Random(n); + var ind := Random(i + 1); var v := l[i]; l[i] := l[ind]; l[ind] := v; @@ -10756,10 +10754,9 @@ end; /// Перемешивает элементы списка случайным образом function Shuffle(Self: List): List; extensionmethod; begin - var n := Self.Count; - for var i := 0 to n - 1 do + for var i := Self.Count - 1 downto 1 do begin - var r := Random(n); + var r := Random(i + 1); var v := Self[i]; Self[i] := Self[r]; Self[r] := v; @@ -11814,9 +11811,8 @@ end; /// Перемешивает элементы массива случайным образом function Shuffle(Self: array of T): array of T; extensionmethod; begin - var n := Self.Length; - for var i := 0 to n - 1 do - Swap(Self[i], Self[Random(n)]); + for var i := Self.Length - 1 downto 1 do + Swap(Self[i], Self[Random(i + 1)]); Result := Self; end;