hw3: PhotoAlbumModel: improve performance by returning unmodifiable list rather than copying
This commit is contained in:
parent
0fb5fd0654
commit
d4705dc11e
@ -64,7 +64,7 @@ public class PhotoAlbumModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<Photo> getPhotos() {
|
public List<Photo> getPhotos() {
|
||||||
return new ArrayList<>(photos);
|
return Collections.unmodifiableList(photos);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Photo getCurrentPhoto() {
|
public Photo getCurrentPhoto() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user