public int LastIndexOf(object x) { var idx = Tail.LastIndexOf(x); return(idx >= 0 ? 1 + idx : Head.Equals(x) ? 0 : -1); }
public int IndexOf(object x) { var idx = Tail.IndexOf(x); return(Head.Equals(x) ? 0 : idx >= 0 ? 1 + idx : -1); }