public Arrayx <T> Map(Func <T, T> callback) { var result = Arrayx <T> .New(Length); for (int i = 0; i < Length; i++) { result.Add(callback(Elements[i])); } return(result); }
public Arrayx <T> Filter(Func <T, bool> callback, bool first = false) { var result = Arrayx <T> .New(Length); for (int i = 0; i < Length; i++) { if (callback(Elements[i])) { result.Add(Elements[i]); if (first) { break; } } } return(result); }