... although the SameMethods function was introduced in version 2.3
Yes. How old versions of Lazarus people plan to use? Generally speaking a new version is better than old versions.
This is from the fixes_3_0 branch, unit LazMethodList.
function SameMethod(const m1, m2: TMethod): boolean; inline;
function CompareMethods(const m1, m2: TMethod): boolean; inline;
deprecated 'Use SameMethod instead.'; // In 2.3 October 2021. Remove in 2.5.
CompareMethods was deprecated in 2021. Now it is 2025. Moral of the story: read the "
deprecated" messages!
The reason for the change: By convention CompareXXX() functions return an integer, like "
function CompareText(const S1, S2: string): Integer;"
SameXXX() functions return a Boolean, like "
function SameText(const s1,s2: String): Boolean;"
CompareMethods() returning a Boolean was confusing.