Skip to content

Commit

Permalink
Change from arrayList to immutableList in OrderedComposite#iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
sjh836 authored and fmbenhassine committed Sep 13, 2023
1 parent 11169ba commit d9bf57e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ else if (!unordered.contains(item)) {
* @return an iterator over the list of items
*/
public Iterator<S> iterator() {
return new ArrayList<>(list).iterator();
return Collections.unmodifiableList(list).iterator();
}

/**
Expand Down

0 comments on commit d9bf57e

Please sign in to comment.