eclipse / xtext-lib

Eclipse Xtext™ Libraries
https://www.eclipse.org/Xtext/
Eclipse Public License 2.0
19 stars 33 forks source link

[eclipse/xtext-xtend#877] added 'contains' to array/iterable/iterator #229

Closed riederm closed 5 years ago

riederm commented 5 years ago

added a contains method to arrayExtensions for Object and all scalar datatypes as well as for Iterables and Iterators. It uses java.lang.Objects.equals(...) where applicable.

Furthermore I added tests for the different ArrayExtension methods

Signed-off-by: Mathias Rieder mathias.rieder@gmail.com

szarnekow commented 5 years ago

Do we want to add other popular collection / list methods, too to avoid the hidden cost of conversions that we nowadays have? Which candidates can you think of? indexOf(..), lastIndexOf(..).

cdietrich commented 5 years ago

how shall we proceed with this pr

kthoms commented 5 years ago

@riederm Do you plan to address the review comments?

riederm commented 5 years ago

sorry for the delay, the branch was still pending locally on my machine, because I haven't found the time yet the properly think about @szarnekow 's comment regarding "... other popular collection methods". Maybe I can create a seperate PR once i find the time?

cdietrich commented 5 years ago

@szarnekow @tivervac anything left open from your side?