seq.CountOf(x)

This commit is contained in:
Mikhalkovich Stanislav 2020-12-05 22:30:38 +03:00
parent 1a278a164b
commit 06db422b61
6 changed files with 22 additions and 6 deletions

View file

@ -15,7 +15,7 @@ internal static class RevisionClass
public const string Major = "3";
public const string Minor = "7";
public const string Build = "1";
public const string Revision = "2760";
public const string Revision = "2762";
public const string MainVersion = Major + "." + Minor;
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;

View file

@ -1,4 +1,4 @@
%COREVERSION%=1
%REVISION%=2760
%REVISION%=2762
%MINOR%=7
%MAJOR%=3

View file

@ -1 +1 @@
3.7.1.2760
3.7.1.2762

View file

@ -1 +1 @@
!define VERSION '3.7.1.2760'
!define VERSION '3.7.1.2762'

View file

@ -9798,7 +9798,6 @@ begin
end;
/// Возвращает отсортированную по возрастанию последовательность
function Sorted<T>(Self: sequence of T): sequence of T; extensionmethod;
begin
@ -10314,6 +10313,15 @@ end;
// ToDo Сделать AdjacentGroup с функцией сравнения
/// Возвращает количество элементов, равных указанному значению
function CountOf<T>(Self: sequence of T; x: T): integer; extensionmethod;
begin
Result := 0;
foreach var y in Self do
if y = x then
Result += 1;
end;
// -----------------------------------------------------
//>> Методы расширения списков # Extension methods for List T
// -----------------------------------------------------

View file

@ -9798,7 +9798,6 @@ begin
end;
/// Возвращает отсортированную по возрастанию последовательность
function Sorted<T>(Self: sequence of T): sequence of T; extensionmethod;
begin
@ -10314,6 +10313,15 @@ end;
// ToDo Сделать AdjacentGroup с функцией сравнения
/// Возвращает количество элементов, равных указанному значению
function CountOf<T>(Self: sequence of T; x: T): integer; extensionmethod;
begin
Result := 0;
foreach var y in Self do
if y = x then
Result += 1;
end;
// -----------------------------------------------------
//>> Методы расширения списков # Extension methods for List T
// -----------------------------------------------------