tweaking friend function

Hi
I intalled the lates wp + buddypress on my computer
I am trying to disallow friendship between men and women
in database the field man or woman is set in wp_bp_xprofile_data
a lot of things are mixed in there
the “man or woman” field is field_id = 2
In order to do that I tried to tweak bp-friends-functions.php in two ways
the first way wich is not good but works