1
0
mirror of https://github.com/amix/vimrc synced 2025-06-17 10:55:00 +08:00

Updated plugins

This commit is contained in:
Amir
2020-04-25 21:56:16 -04:00
parent d98c510eee
commit fef069af24
114 changed files with 4018 additions and 988 deletions

View File

@ -308,16 +308,29 @@ endsnippet
# methods #
#############
snippet equals "Equals method" b
public override bool Equals(object obj)
snippet equals "Equality for a type" b
public override bool Equals(object obj) => Equals(obj as ${1:TYPE});
public bool Equals($1 other) // IEquatable<$1>
{
if (obj == null || GetType() != obj.GetType())
{
if (object.ReferenceEquals(other, null))
return false;
if (object.ReferenceEquals(this, other))
return true;
if (this.GetType() != other.GetType())
return false;
}
$0
return base.Equals(obj);
return base.Equals(other);
}
public override int GetHashCode() => base.GetHashCode();
public static bool operator ==($1 x, $1 y) =>
(object.ReferenceEquals(x, null) && object.ReferenceEquals(y, null))
|| (!object.ReferenceEquals(x, null) && x.Equals(y));
public static bool operator !=($1 x, $1 y) => !(x == y);
endsnippet
snippet mth "Method" b